我得到以下錯誤:Configuration.resolve有未知屬性「根」
無效的配置對象。 Webpack已使用不匹配API模式的 配置對象進行初始化。 - configuration.resolve有一個未知屬性'root'。這些屬性是有效的:object {alias?,aliasFields ?, cachePredicate?,descriptionFiles?,enforceExtension ?, enforceModuleExtension?,extensions ?, fileSystem ?, mainFields ?, mainFiles?,moduleExtensions?,modules?,plugins?,resolver ?, 符號鏈接?,unsafeCache?,useSyncFileSystemCalls? }
我webpack.config.js看起來是這樣的:
module.exports= {
entry:'./public/app.jsx',
output: {
path: __dirname,
filename:'./public/bundle.js'
},
resolve: {
root: __dirname,
alias:{
Mod1: 'public/components/mod1.jsx',
Mod2:'public/components/mod2.jsx',
Mod3: 'public/components/mod3.jsx'
},
extensions: ['*','.js','.jsx']
},
module :{
loaders:[{
loader :'babel-loader',
query :{
presets:['react','es2015','es2017']
},
test:/\.jsx?$/,
exclude:/(node_modules|bower_components)/
}]
}
};