react multiple entrances:
webpack extract common module, compilation can pass, but execute JS error: "Uncaught ReferenceError: exports is not defined"
look at the big difference between the compiled file and the normally compiled file: for example,
exports.ids = [6];
exports.modules = {
/***/ 100:
/***/ (function(module, exports) {
module.exports = function (it, Constructor, name, forbiddenField) {
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
throw TypeError(name + ": incorrect invocation!");
} return it;
};
The error is located to the first line.
does this have anything to do with babel configuration? The configuration code is as follows:
{
"presets": [
["es2015", {
// "modules": false
}],
"stage-2",
"react"
],
"plugins": [
"transform-decorators-legacy",
"react-hot-loader/babel", ["transform-runtime", {
"helpers": false,
"polyfill": true,
"regenerator": true,
"moduleName": "babel-runtime"
}]
]
}
ask the masters to help me solve my confusion.
problem description
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)