Deploying ES2015+ Code in Production Today
I love this, but I'm missing a key piece to make this effective for non-tiny code bases.<p>The author proposes using 2 webpack configs, one for es2015 and one for es5. That means running webpack twice from scratch. This, in turn, means you can't effectively use webpack's devserver because that's just a single instance with a single webpack config.<p>The author's boilerplate [0] "solves" that by hand-coding a watcher based on chokidar which just rebuilds both files on every change. On our code base, clean webpack builds take minutes (and when babel is even configured to exclude /node_modules/, as the author recommends against). If we'd follow the author's advice, we'd be waiting for minutes every time we make a change.<p>Anyone got a good idea here? The best I can come up with is to use the es2015 build (but with node_modules excluded) in dev mode, and then for staging and production, running webpack twice as the author suggests. That makes the dev version rather different from both the production es2015 output and the production es5 output, however, so if there's any bug in the chain anywhere (babel bug, webpack bug, babel-env browser support table error, etc etc) we may not always find it.<p>In all honesty that itches me a bit (even though by skipping uglify in dev mode we already depend on at least 1 tool being essentially bug-free). Any ideas?<p>[0] <a href="https://github.com/philipwalton/webpack-esnext-boilerplate" rel="nofollow">https://github.com/philipwalton/webpack-esnext-boilerplate</a>