- vue-cli3.0 配置babel.config.js的时候,总是报错..ReferenceError: Unknown option
Failed to compile.
./src/router.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
ReferenceError: Unknown option: .chainWebpack. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
at throwUnknownError (C:\Users\Administrator\Desktop\pbb\app\node_modules\@babel\core\lib\config\validation\options.js:123:11)
at Object.keys.forEach.key (C:\Users\Administrator\Desktop\pbb\app\node_modules\@babel\core\lib\config\validation\options.js:107:5)
at Array.forEach (<anonymous>)
at validateNested (C:\Users\Administrator\Desktop\pbb\app\node_modules\@babel\core\lib\config\validation\options.js:83:21)
at validate (C:\Users\Administrator\Desktop\pbb\app\node_modules\@babel\core\lib\config\validation\options.js:74:10)
at file (C:\Users\Administrator\Desktop\pbb\app\node_modules\@babel\core\lib\config\config-chain.js:169:34)
at cachedFunction (C:\Users\Administrator\Desktop\pbb\app\node_modules\@babel\core\lib\config\caching.js:33:19)
at buildRootChain (C:\Users\Administrator\Desktop\pbb\app\node_modules\@babel\core\lib\config\config-chain.js:89:27)
at loadPrivatePartialConfig (C:\Users\Administrator\Desktop\pbb\app\node_modules\@babel\core\lib\config\partial.js:85:55)
at Object.loadPartialConfig (C:\Users\Administrator\Desktop\pbb\app\node_modules\@babel\core\lib\config\partial.js:110:18)
at Object.<anonymous> (C:\Users\Administrator\Desktop\pbb\app\node_modules\babel-loader\lib\index.js:144:26)
at Generator.next (<anonymous>)
at asyncGeneratorStep (C:\Users\Administrator\Desktop\pbb\app\node_modules\babel-loader\lib\index.js:3:103)
at _next (C:\Users\Administrator\Desktop\pbb\app\node_modules\babel-loader\lib\index.js:5:194)
at C:\Users\Administrator\Desktop\pbb\app\node_modules\babel-loader\lib\index.js:5:364
at new Promise (<anonymous>)
package.json
{
"name": "app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^2.6.5",
"vant": "^1.6.20",
"vue": "^2.6.10",
"vue-router": "^3.0.3",
"vuex": "^3.0.1"
},
"devDependencies": {
"@babel/core": "^7.4.5",
"@vue/cli-plugin-babel": "^3.8.0",
"@vue/cli-plugin-eslint": "^3.8.0",
"@vue/cli-service": "^3.8.0",
"@vue/eslint-config-standard": "^4.0.0",
"babel-eslint": "^10.0.1",
"babel-plugin-import": "^1.11.2",
"babel-polyfill": "^6.26.0",
"es6-promise": "^4.2.6",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"less": "^3.0.4",
"less-loader": "^4.1.0",
"vue-template-compiler": "^2.6.10"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"@vue/standard"
],
"rules": {},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
- 请问各路大神,这个要怎么解决?
我写错地方了!!
应该写在vue.config.js我写在了babel.config.js里了...
果然还是得 脑袋清醒的时候写代码.