Skip to content

Instantly share code, notes, and snippets.

@also
Last active March 22, 2018 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save also/c16bc7c1dbe05f9e549987862221d9be to your computer and use it in GitHub Desktop.
Save also/c16bc7c1dbe05f9e549987862221d9be to your computer and use it in GitHub Desktop.
webpack semaphore bug

webpack semaphore bug

Webpack introduced a semaphore in webpack/webpack#5502 to limit the number of modules that are processed in parallel. This semaphore does not support recursively building modules with .loadModule() in a loader and exits without finishing or displaying an error.

// index.js
// loaded.js
module.exports = function (source) {
const callback = this.async();
this.loadModule('./loaded', (err, loaded) => {
callback(null, source + '\n\n' + loaded);
});
};
{
"dependencies": {
"webpack": "3.11.0"
}
}
module.exports = {
entry: './loader.js!./index.js',
output: {filename: '[name].js'},
parallelism: 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment