我有以下Webpack配置:
{
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
module: {
loaders: [
{
test: /.es6?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
sourceMap: true,
presets: [
'es2015'
],
plugins: [
'transform-class-properties'
]
}
}
]
}
}
我的项目结构:
.
+-- deploy
| +-- node_modules
| +-- Gulpfile.js
+-- es6
| +-- Source files
我得到的错误:
ERROR in ../es6/src.es6
Module build failed: ReferenceError: Unknown plugin "transform-class-properties" specified in "base" at 0, attempted to resolve relative to "[ABSOLUTE_PATH]/es6"
似乎resolveLoader由于某种原因无法工作。
尝试删除transform-class-properties
插件,但es2015
预设也会出现同样的错误。
有什么建议吗?
enter code here
更换装载机x规则:
module: {
loaders: [
{
}
]
}