Skip to content

Reflect other changes in configuration after switching to Webpack 2 #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2016

Conversation

deepj
Copy link
Contributor

@deepj deepj commented Dec 17, 2016

After switching to Webpack 2.2, any Rails' Webpack command fails on the following issue:

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

Unfortunately, Webpack 2.x has many improvements since Webpack 1.x. The following changes haven't been reflected in PR #27 in config/development.js.

After these changes, any Rails' Webpack command works.

$ bin/webpack
Hash: 9c473eec14e1e3000365
Version: webpack 2.2.0-rc.0
Time: 2310ms
             Asset     Size  Chunks             Chunk Names
    hello_react.js   780 kB       0  [emitted]  [big]hello_react
    application.js  3.42 kB       1  [emitted]  application
hello_react.js.map   866 kB       0  [emitted]  hello_react
application.js.map  3.35 kB       1  [emitted]  application
 [177] ../app/javascript/packs/application.js 511 bytes {1} [built]
 [178] ../app/javascript/packs/hello_react.js 2.71 kB {0} [built]
    + 177 hidden modules

@dhh dhh merged commit c1c872c into rails:master Dec 17, 2016
@deepj deepj deleted the reflect-changes-after-switching-to-webpack2 branch December 17, 2016 08:49
tagliala pushed a commit to tagliala/webpacker that referenced this pull request Jan 25, 2022
PR rails#21 removed pnp-webpack-plugin as a dev dependency but did not remove
it from the peer dependency list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants