rails webpack-dev-server“无效的配置对象”

问题描述 投票:2回答:1

[当我尝试运行./bin/webpack-dev-server时,我得到了:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration has an unknown property 'mode'. These properties are valid:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, parallelism?, performance?, 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.
     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: {
           mode: ...
         }
       })
     ]

我很确定这与套件版本混为一谈。我可以运行“重新安装所有内容”命令吗?

我的版本是

[email protected]

@@ rails/[email protected]

ruby-on-rails webpack webpack-dev-server
1个回答
0
投票

[很有可能是webpacker.yml的问题。就我而言,source_path不正确。

查看此:Invalid configuration object when starting webpack-dev-server

© www.soinside.com 2019 - 2024. All rights reserved.