我有以下 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
预设相同的错误。
有什么建议吗?