作者:格林威治 | 来源:互联网 | 2023-06-08 16:12
下面是我的配置文件12345678910111213141516171819 babel: { babelrc: false, presets: [ ['es2015', {m
下面是我的配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| babel: {
babelrc: false,
presets: [
['es2015', {modules: false}],
'stage-1'
],
plugins: [
'transform-vue-jsx'
]
},
postcss: [
require('autoprefixer')({
// Vue does not support ie 8 and below
browsers: ['last 2 versions', 'ie > 8']
}),
require('postcss-nested')
],
cssModules: true,
} |
下面是报错信息:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
configuration has an unknown property 'vue'. These properties are valid:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
For typos: please correct them.
For loader options: webpack 2 no longer allows custom properties in configuration.
1 2 3 4 5 6 7 8 9 10
| Loaders should be updated to allow passing options via loader options in module.rules.
Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
plugins: [
new webpack.LoaderOptionsPlugin({
// test: /\.xxx$/, // may apply this only for some modules
options: {
vue: ...
}
})
] |