Created
February 15, 2019 15:32
-
-
Save DroopyTersen/a8820b6ddc69e228713845e0cffaee95 to your computer and use it in GitHub Desktop.
Prevent SPFx from marking React as an external so that React in included in your bundle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gulp = require('gulp'); | |
const build = require('@microsoft/sp-build-web'); | |
build.addSuppression("Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe."); | |
build.configureWebpack.mergeConfig({ | |
additionalConfiguration: (generatedConfiguration) => { | |
generatedConfiguration.externals = generatedConfiguration.externals | |
.filter(name => !(["react", "react-dom"].includes(name))) | |
return generatedConfiguration; | |
} | |
}); | |
build.initialize(gulp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment