WebPack 4 should use "mini-css-extract-plugin" instead of "extract-text-webpack-plugin"
See original GitHub issueI’m submitting a bug report
- Library Version: 0.33.1
Please tell us about your environment:
-
Operating System: Windows 10
-
Node Version: 9.11.1
-
NPM Version: 5.6.0
-
Browser: all
-
Language: all
-
Loader/bundler: Webpack 4
Current behavior:
- What is the expected behavior?
Try to run a Prod build with
au build --env prod
ornpm run build
and you will get the following warning
DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
Also on the extract-text-webpack-plugin GitHub it is mentioned that this package is deprecated with WebPack 4
Since webpack v4 the extract-text-webpack-plugin should not be used for css. Use mini-css-extract-plugin instead.
- What is the motivation / use case for changing the behavior? Get a working build/bundle
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (8 by maintainers)
Top Results From Across the Web
setup MiniCssExtractPlugin from ExtractTextPlugin
I was using the plugin incorrectly it seems. I changed by adding this to my build configs new MiniCssExtractPlugin({ filename: ...
Read more >MiniCssExtractPlugin
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >Webpack 4 | Mobify DevCenter
As of Webpack 4, mini-css-extract-plugin should be used for CSS in place of extract-text-webpack-plugin. To comply, make these changes to these four files:....
Read more >Step-by-step Guide to Upgrading to Webpack 4 - Oleg Chursin
Sub extract-text-webpack-plugin with mini-css-extract-plugin ... by default it use publicPath in webpackOptions.output publicPath: '../'
Read more >extract-text-webpack-plugin > JavaScript for PHP Geeks
... instead of embedding CSS in JavaScript. Tip. In Webpack 4 you can use the beta version extract-text-webpack-plugin@4.0.0-beta.0 or there is a new...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So it took me about 2 hours to get it working, but the good news is I got it working. I’m not sure if it’s the most efficient way and if the settings are correct.
Step 1 (
package.json
)in
package.json
do the following changeStep 2 (
webpack.config.js
)in
webpack.config.js
I changed the followingSo the good news is that if I try to do a
yarn run build
and/oryarn run
, they both work (Dev/Prod). It would be great if Aurelia CLI would be updated to support these changes since again they do mention that the old plugin is deprecated and we should move to the new mini version@JeroenVinke just collection quickly
prevent eg bluebird to be included in both, vendor and app bundle
don’t parse json twice. needed eg for aurelia-i18n with build-in loader
i think over css setting isn’t minifing, se needs eg
it could be explored if following could be added with some useful defaults