Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 modules gets the same ID with expose-loader #12

Open
florian-bd opened this issue Mar 10, 2017 · 3 comments
Open

2 modules gets the same ID with expose-loader #12

florian-bd opened this issue Mar 10, 2017 · 3 comments

Comments

@florian-bd
Copy link

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.

@zhenyong
Copy link
Owner

zhenyong commented Mar 13, 2017

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

@florian-bd
Copy link
Author

florian-bd commented Mar 13, 2017

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

@zhenyong
Copy link
Owner

zhenyong commented Mar 14, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants