webpack-stable-module-id-and-hash icon indicating copy to clipboard operation
webpack-stable-module-id-and-hash copied to clipboard

2 modules gets the same ID with expose-loader

Open florian-bd opened this issue 8 years ago • 3 comments

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 avatar Mar 10 '17 16:03 florian-bd

@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.

zhenyong avatar Mar 13 '17 03:03 zhenyong

Ok thank you for your answer. I will see what I can do. Maybe you could specify that in the README somewhere :)

florian-bd avatar Mar 13 '17 08:03 florian-bd

@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. ^_^

zhenyong avatar Mar 14 '17 07:03 zhenyong