-
-
Save lettertwo/0bc711c39de7cc9ab484 to your computer and use it in GitHub Desktop.
An illustration of the Webpack 1.1.8 entry emission issue when in watch mode (https://github.com/webpack/webpack/issues/256)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is our entry point. | |
// We use `require.ensure` to tell webpack to generate a chunk that bundles `B.js` | |
require.ensure(['./B'], function (require) { | |
require('./B'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// After starting watch.js, make a change to this file to see the issue | |
console.log('B?'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Start this file with `node watch.js` | |
webpack = require('webpack'); | |
path = require('path'); | |
webpack({ | |
entry: { | |
A: ['./A'] | |
}, | |
output: { | |
path: path.join(__dirname, 'built'), | |
filename: '[name]-built.js', | |
chunkFilename: '[chunkhash].js' | |
} | |
}).watch(100, function (err, stats) { | |
if (err) console.log(err); | |
console.log(stats.toString({colors: true, chunks: false})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment