-
Notifications
You must be signed in to change notification settings - Fork 95
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
Support for webpack 4 #255
Comments
Thx for opening the issue, @marcofugaro! I like the |
It looks like we are going to have a major bump of |
I forgot to add, there is probably the need for an |
@marcofugaro is't the |
@vlad-zhukov yeah but |
@vlad-zhukov Yeah, I totally agree. We can take webpack-blocks as it is and make it the final v1.0.0. Can then do a major bump for webpack 4. I am just terribly busy and have little time. Help from all contributors is highly appreciated 😊 |
@marcofugaro Could you, please, outline which features need to be done in order to support webpack 4? |
@dmitmel what do you mean? All of them are necessary |
I want to open a PR so I must know what features to add.
Do you mean features described in the issue description? |
Yup. |
I'm working on webpack 4 features but I'm stuck with the
Any thoughts? P.S. I personally like more the first idea because we already have |
How do you think, should |
I'd say explicit is better than implicit, so let's set the
But it might make sense to put the mode into the context, anyhow, since it's a pretty important setting that you might want to react to in other blocks as well. |
I'd make the mode('development', {
splitChunks: 'all',
}); |
@vlad-zhukov It's better two use two blocks because each of them has a different task. |
@dmitmel Some of the options in From the changelog:
Those options are Making it more explicit leads to less buggy webpack config. I think it should be supported both an optional parameter in the |
@vlad-zhukov @marcofugaro The second parameter for |
Any updates on this? |
Updated the OP message with the |
@dannyphillips Upgrade to webpack 4 requires a lot of breaking changes in webpack-blocks, so we have to release a new major version ( |
As I pointed in #279, Extract Text Plugin is deprecated for CSS in favour of mini-css-extract-plugin. Do we need to keep the |
Would be fine to me to replace |
FYI: Published v2.0.0-alpha with webpack 4 support. Install using |
I found and error using Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.entry should be one of these:
object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string] | function After taking a look at the devServer code seems like the Webpack's default "entry" is being replaced with nothing. EDIT: I removed the "entry" from the block default values and it's working. |
Hmmm, why does the |
Anyways, I thinks since ...
"scripts": {
"start": "webpack-serve",
},
... |
@IngenieroLata Does |
@vlad-zhukov yes it works for me, but there are certain options that only work with the command line. webpack-contrib/webpack-serve#237 I think ...
"scripts": {
"start": "webpack-serve --log-level error",
},
... On the other hand, the hot-client seems to have some issues webpack-contrib/webpack-serve#218 |
Hey, I tried to update the mini-css-extract block but couldn't figure out all the logic that is inside the current extract-text block, and was afraid I might mess something up. Here is a basic block of the const MiniCssExtractPlugin = require('mini-css-extract-plugin')
function extractCss(options) {
return (context, util) => util.merge({
module: {
rules: [
Object.assign({
test: /\.css$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
],
}, context.match)
]
},
plugins: [
new MiniCssExtractPlugin(options),
],
}
}
// usage
extractCss({
filename: 'app.[contenthash:8].css',
chunkFilename: '[name].[contenthash:8].chunk.css',
}) |
Welp, they did a 180 and deprecated |
Well, less work for us... 🙈🙈 Thx for pointing out! |
May I ask what the status of this issue is? |
Thanks for pointing out, @Telokis! Yes, I think that issue has been resolved long ago. If anyone likes to disagree (but I sincerely doubt that), now is your chance 😉 |
Webpack4
is currently in betahas been released, quite some things changed.Taking a look from the changelog, here is what needs to be done in order to support webpack 4:
mode
block, I imagined it something likemode('production', { minimize: false })
sinceoptimization.minimizer[0]
NamedModulesPlugin
plugin)webpack-dev-server
has been deprecated in favour ofwebpack-serve
extract-text-webpack-plugin
is deprecated for CSS in favour ofmini-css-extract-plugin
thank you! I probably missed something else...
The text was updated successfully, but these errors were encountered: