Skip to content

Commit 82cf58a

Browse files
committed
Need to dedupe to avoid crazy bugs in react
When multiple instances of React are loaded spooky things will happen.
1 parent 35432df commit 82cf58a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

webpack.local.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ module.exports = {
4949
new webpack.HotModuleReplacementPlugin(),
5050
new webpack.NoErrorsPlugin(),
5151
// extract inline css into separate 'styles.css'
52-
new ExtractTextPlugin('styles.css', {allChunks: true})
52+
new ExtractTextPlugin('styles.css', {allChunks: true}),
53+
new webpack.optimize.DedupePlugin()
5354
],
5455

5556
// Automatically transform files with these extensions

webpack.production.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
var ExtractTextPlugin = require('extract-text-webpack-plugin');
55
var path = require('path');
6+
var webpack = require('webpack');
67

78
module.exports = {
89
entry: "./src/main",
@@ -27,7 +28,8 @@ module.exports = {
2728
},
2829

2930
plugins: [
30-
new ExtractTextPlugin('styles.css', { allChunks: true })
31+
new ExtractTextPlugin('styles.css', { allChunks: true }),
32+
new webpack.optimize.DedupePlugin()
3133
],
3234
resolveLoader: {
3335
root:

0 commit comments

Comments
 (0)