我有以下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
预设获得相同的错误。
有什么建议吗?
答案 0 :(得分:0)
enter code here
更换装载机x规则:
module: {
loaders: [
{
}
]
}