-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[BREAKING CHANGE] webpack 4 #3148
Conversation
# Conflicts: # app/angular/package.json # app/polymer/package.json # app/react-native/package.json # app/react/package.json # app/react/src/server/config/webpack.config.js # app/vue/package.json # lib/core/package.json
Weird, storybook build for polymer works OK locally on my machine, but on CI it's failing:
UPD: this should be fixed with #3161 |
Codecov Report
@@ Coverage Diff @@
## master #3148 +/- ##
==========================================
+ Coverage 36.19% 36.21% +0.01%
==========================================
Files 444 444
Lines 9741 9736 -5
Branches 914 905 -9
==========================================
Hits 3526 3526
- Misses 5650 5655 +5
+ Partials 565 555 -10
Continue to review full report at Codecov.
|
For now, I've just disabled |
Both plugins are rather simple, maybe it worth copypasting/fixing them into the core until the official support? |
They say they're almost ready: facebook/create-react-app#4077 (comment) |
Could you also in this work stream upgrade |
@pkuczynski sure, definitely makes sense. I think it'll be a separate PR though |
Cool! I can provide a PR even now, as this is not related to webpack and I am being able to successfully use And why do you need to wait for babel/babel#7472? |
Because it will help to solve a lot of issues we currently have because of custom babelrc resolution See e.g. #2582 (comment) #2771 #754 #2635 #2610 |
But then it would require quite some work on your side I guess? While basic upgrade to babel@7 should work out of the box now. So maybe it’s worth to do it in two steps? |
Probably so. Feel free to give it a try |
# Conflicts: # examples/polymer-cli/package.json # examples/vue-kitchen-sink/package.json
Here is more clever candidates for fix:
...
apply(compiler) {
compiler.plugin('compilation', compilation => {
const handler = (data, callback) => {
// Run HTML through a series of user-specified string replacements.
Object.keys(this.replacements).forEach(key => {
const value = this.replacements[key];
data.html = data.html.replace(
new RegExp('%' + escapeStringRegexp(key) + '%', 'g'),
value
);
});
callback(null, data);
};
if (compilation.hooks) {
compilation.hooks.htmlWebpackPluginBeforeHtmlProcessing
.tapAsync('InterpolateHtmlPlugin', handler);
} else {
compilation.plugin('html-webpack-plugin-before-html-processing', handler);
}
});
}
I've converted Set into an Array, but I'm not sure whether webpack have changed only underlying type or set item type too. I hope that there are still strings as before :) apply(compiler) {
compiler.plugin('emit', (compilation, callback) => {
var missingDeps = compilation.missingDependencies;
var nodeModulesPath = this.nodeModulesPath;
// If any missing files are expected to appear in node_modules...
if (Array.from(missingDeps).some(file => file.indexOf(nodeModulesPath) !== -1)) {
// ...tell webpack to watch node_modules recursively until they appear.
compilation.contextDependencies.push(nodeModulesPath);
}
callback();
});
} |
It's actualy already fixed in facebook/create-react-app#4077 and we've released it from our fork as I'll send a hotfix PR ASAP |
@ishantdigitalgenius try to use the same version of addons as the rest of the |
Fix released as |
With 4.0.0-alpha.1 I still have the jantimon/html-webpack-plugin#870 issue.. :(
|
We probably need to apply workaround from jantimon/html-webpack-plugin#870 (comment) For now, you can try to apply it from custom webpack config (full control mode):
|
chunkSortMode none will be the default in the next html-webpack-plugin major release. But I would like to combine it with other breaking changes so it will take some time to publish it |
Thank you! Storybook is now working with Webpack 4 and custom Webpack configs but, just so you know, I had to add |
|
The following settings worked for me.
|
We strongly recommend to use the same versions for |
Following settings doesn't work for me
when running storybook it returns the error
any suggestion? |
@VRedondo you need to use |
That's not true. You should be able to use babel 6 with latest alpha, you just need babel-loader 7 for it |
Thanks @SleepWalker and @Hypnosphi actually both were needed, babel-loader 7 requires babel 7 so it got fixed with |
What made you think so? |
@Hypnosphi the console output says
when running with babel-loader 7 in case you don't have babel 7 |
Yeah, you also need your own |
Issues: #3044, #3083, #3085, #3092, #3115, #3116, #3135
Things that block this right now
3.4.0
release (we don't want to maintain 3 versions at the same time)(actually they work as is now)react-dev-utils
, namelyInterpolateHtmlPlugin
andWatchMissingNodeModulesPlugin
. See Webpack 4 facebook/create-react-app#4077