Question: How to handle multiple bundles?
dcworldwide opened this issue · comments
This has really helped me out. Thanks for sharing.
I can get it working with a single bundle, but what about when using chunks?
I.e.
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity
}),
],
How would I change server.js
var WebpackDevServer = require('webpack-dev-server');
var webpack = require('webpack');
var config = require('./webpack.config.js');
var path = require('path');
var compiler = webpack(config);
var server = new WebpackDevServer(compiler, {
contentBase: 'dist',
hot: true,
// filename: '/dist/main.bundle.js',
filename: 'bundle.js',
publicPath: '/',
stats: {
colors: true,
},
});
server.listen(8080, 'localhost', function() {});
..and my index.html (in dist folder)
<body>
<div id="example"></div>
<!-- Dependencies -->
<script src="https://js.arcgis.com/3.17/"></script>
<!-- Main -->
<script src='/bundle.js'></script>
</body>
Closing because I'm archiving the repo. Sorry I wasn't able to help - never had time to dig into this issue.