webpack-stable-module-id-and-hash
webpack-stable-module-id-and-hash copied to clipboard
2 modules gets the same ID with expose-loader
In my project I expose React with the following code
{
test: require.resolve('react'),
loader: 'expose?React'
}
When I use this plugin, I end up with a bad webpack file:
/***/ 5896763357248615:
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(6285320399463177);
/***/ },
/***/ 5896763357248615:
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {module.exports = global["React"] = __webpack_require__(5896763357248615);
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
You can see that 2 modules have the same ID, which messes up all the require of react.
@florian-bd
Like #2 , exactly as your description, using this plugin with 'expose' may lead to this terrible problem. I have read expose plugin source code and can't find the behind problem at once. Sorry for that.
Ok thank you for your answer. I will see what I can do. Maybe you could specify that in the README somewhere :)
@florian-bd
Thank your remind. I have specified that in README. I have tried to fix it and made some experiment (mentioned in #4 ), however time limited. Hope you can fix it. ^_^