-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
WebPack 4 should use "mini-css-extract-plugin" instead of "extract-text-webpack-plugin" #900
Comments
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 (
|
good work, but: https://github.com/webpack-contrib/mini-css-extract-plugin#readme
|
Unless I'm wrong, this code [
{
loader: MiniCssExtractPlugin.loader
},
'css-loader'
] is executed for Prod build (that is when So I think it's fine |
right. and seems to work fine if you're feeling lucky maybe make a PR to adjust |
Might be worth considering splitting this issue into two separate ones? |
Why separate? |
Hmm - are you sure? I followed your steps to remove ExtractTextPlugin, and I still get the DeprecationWarning. Perhaps there is something else you did? |
hmm no I don't think there's anything that needs to be done. Every search on Google that points to GitHub issues, on half of them they say to use the MiniCssExtract or try updating to You can take a look at the project, which is a demo for Aurelia-Slickgrid that is shared, anyway here's the webpack.config.js for the demo which uses latest Aurelia/Bootstrap 4/WebPack 4 and let me know if you spot anything else that should be part of this issue. Perhaps this SO might help? Seems like this warning might not be just for the Text-Extract plugin but maybe some other ones too |
Made the change here: e9641e4 Thanks everyone, let me know if there's anything else that has to be updated/changed |
@JeroenVinke prevent eg bluebird to be included in both, vendor and app bundle optimization: production ? {
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
chunks: 'all',
},
},
},
} : {}, don't parse json twice. needed eg for aurelia-i18n with build-in loader {
type: 'javascript/auto',
test: /\.json$/,
use: ['json-loader'],
}, i think over css setting isn't minifing, se needs eg ...when(production, new OptimizeCssAssetsPlugin({
cssProcessorOptions: {
safe: true,
discardComments: { removeAll: true },
},
})), it could be explored if following could be added with some useful defaults
|
I'm submitting a bug report
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:
Try to run a Prod build with
au build --env prod
ornpm run build
and you will get the following warningDeprecationWarning: 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
Get a working build/bundle
The text was updated successfully, but these errors were encountered: