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.
Last active
March 22, 2018 16:14
-
-
Save also/c16bc7c1dbe05f9e549987862221d9be to your computer and use it in GitHub Desktop.
webpack semaphore bug
This file contains hidden or 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
// index.js |
This file contains hidden or 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
// loaded.js |
This file contains hidden or 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
module.exports = function (source) { | |
const callback = this.async(); | |
this.loadModule('./loaded', (err, loaded) => { | |
callback(null, source + '\n\n' + loaded); | |
}); | |
}; |
This file contains hidden or 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
{ | |
"dependencies": { | |
"webpack": "3.11.0" | |
} | |
} |
This file contains hidden or 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
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