Skip to content

Commit 8c58ff6

Browse files
authored
Merge pull request #9767 from KManolov3/bugfix/use-react-from-external-source
fix: use react from external source when building dist
2 parents b95b980 + 853caca commit 8c58ff6

File tree

3 files changed

+84
-10
lines changed

3 files changed

+84
-10
lines changed

package-lock.json

Lines changed: 80 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@
6868
"prop-types": "^15.5.10",
6969
"query-string": "^5.1.1",
7070
"raw-loader": "^4.0.0",
71-
"react": "^16.0.0",
7271
"react-contextmenu": "^2.9.4",
73-
"react-dom": "^16.0.0",
7472
"react-draggable": "^3.0.5",
7573
"react-ga": "^2.5.3",
7674
"react-intl": "^2.9.0",
@@ -136,7 +134,7 @@
136134
"redux-mock-store": "1.5.5",
137135
"rimraf": "2.7.1",
138136
"scratch-semantic-release-config": "3.0.0",
139-
"scratch-webpack-configuration": "1.5.1",
137+
"scratch-webpack-configuration": "1.6.0",
140138
"selenium-webdriver": "3.6.0",
141139
"semantic-release": "19.0.5",
142140
"stream-browserify": "3.0.0",

webpack.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ const baseConfig = new ScratchWebpackConfigBuilder(
2525
{
2626
rootPath: path.resolve(__dirname),
2727
enableReact: true,
28-
shouldSplitChunks: false
28+
shouldSplitChunks: false,
29+
publicPath: 'auto'
2930
})
3031
.setTarget('browserslist')
3132
.merge({
@@ -93,6 +94,7 @@ const distConfig = baseConfig.clone()
9394
path: path.resolve(__dirname, 'dist')
9495
}
9596
})
97+
.addExternals(['react', 'react-dom'])
9698
.addPlugin(
9799
new CopyWebpackPlugin({
98100
patterns: [

0 commit comments

Comments
 (0)