Reputation: 2020
How can I use provided by React prebuilt version of a library, instead build it on every webpack's run?
Upvotes: 2
Views: 418
Reputation: 26873
The module.noParse option works for this. You can set it up like this:
const PATHS = {
react: path.join(__dirname, 'node_modules/react/dist/react.min.js')
};
module.exports = {
module: {
noParse: [
PATHS.react
]
},
resolve: {
alias: {
react: PATHS.react
}
}
};
Upvotes: 2