https://gist.github.com/sokra/1522d586b8e5c0f5072d7565c2bee693
https://github.com/webpack/webpack/pull/6341
Since we're going to keep 2.x in alpha stage for at least a month or two as we wait for Babel 7 to get stable, we might as well jump straight to webpack 4.
@Ayc0 Seeing that you worked on #3145 and feel passionate about solving this, would you like to work on this?
I'm gonna see what I can do about it
Thank you!
@Ayc0 lets talk about it here instead. Im thinking lets try to get webpack 4 and new split chunk plugin working first, then we can look at loading some libs from cdn.
Anyway we are semi-blocked from using webpack 4 alpha until this is resolved:
jantimon/html-webpack-plugin#816
WIP PR: jantimon/html-webpack-plugin#823 (also chunks related)
Initial stab. I think i got the overlay building with webpack4 (it has less plugins and loaders so i thought it was a good starting place) https://github.com/andriijas/create-react-app/tree/webpack4
the template wont boot, even if i remove all plugins there seems to be some can not read context of undefined error on the entrypoints.
I'm waiting for webpack 4 to be released, or at least a stable alpha/beta
For the specs, I want to add a vendors.json file that allows users to add multiple vendors in different chunks with this syntax:
["moduleA", "moduleB"]
resulting in vendors.xxx.js
[
["moduleA", "moduleB"],
["moduleC", "moduleD"]
]
resulting in vendor0.xxx.js and vendor1.xxx.js
And
{
"vendor_a": ["moduleA", "moduleB"],
"vendor_b": ["moduleC", "moduleD"]
}
resulting in vendor_a.xxx.js and vendor_b.xxx.js
I don't think that the CDN should be included in this PR because we can just use the external
field of webpack and add the link to the cdn in the index.html
And, as we also want to improve the long term caching, we need to use the name plugin (I think it changed to in webpack 4, not sure...)
and also, I want to activate the optimization.runtimeChunk
@Ayc0 I read this was the last version before stable, so you should be able to start playing with it
https://github.com/webpack/webpack/releases/tag/v4.0.0-beta.0 has been released 馃帀
Gotta go fast 馃榿
Early work: https://github.com/andriijas/create-react-app/tree/webpack4
development
for dev, production
for prod.html-webpack-plugin
Resources:
https://medium.com/webpack/webpack-4-migration-guide-for-plugins-loaders-20a79b927202
Repo: https://github.com/andriijas/create-react-app/tree/webpack4
Note: precache plugin, manifest plugin directly from git branches of pending PRs
Note: Using html-webpack-plugin directly from git, maintainer of repo of grid/on vacation
How to get it running:
clone repo, checkout branch, yarn
cd node_modules/sw-precache-webpack-plugin && npm i && npm run prepare
yarn start/yarn run build
Callbacks seems to have been removed from new webpack plugin API, anyone who know how to handle that in migration of plugins? Thinking of ModuleScopePlugin/InterpolateHtmlPlugin and WatchMissingNodeModulesPlugin
Im going to become the "webpack go-to guy" at work 馃槶
Will this allow us to have a separate vendor bundle once it drops for for react-scripts?
I think it will make most sense to first bring in webpack 4 and then look at how to bundle vendor scripts. @Ayc0 have experience with it and can hopefully help out once we get webpack 4 in.
@Ayc0 Hi, Webpack 4.0.0 is here! https://github.com/webpack/webpack/releases/tag/v4.0.0
Most helpful comment
@Ayc0 Hi, Webpack 4.0.0 is here! https://github.com/webpack/webpack/releases/tag/v4.0.0