Skip to content

Commit d6486d8

Browse files
committed
Warn about duplicate dependencies
1 parent f16eb95 commit d6486d8

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

packages/react-scripts/config/webpack.config.dev.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
1616
var CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
1717
var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
1818
var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
19+
var DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
1920
var getClientEnvironment = require('./env');
2021
var paths = require('./paths');
2122

@@ -224,6 +225,9 @@ module.exports = {
224225
// a plugin that prints an error when you attempt to do this.
225226
// See https://github.com/facebookincubator/create-react-app/issues/240
226227
new CaseSensitivePathsPlugin(),
228+
// Warn about duplicate dependencies.
229+
// See https://github.com/facebookincubator/create-react-app/issues/1844
230+
new DuplicatePackageCheckerPlugin(),
227231
// If you require a missing module and then `npm install` it, you still have
228232
// to restart the development server for Webpack to discover it. This plugin
229233
// makes the discovery automatic so you don't have to restart.

packages/react-scripts/config/webpack.config.prod.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
1616
var ExtractTextPlugin = require('extract-text-webpack-plugin');
1717
var ManifestPlugin = require('webpack-manifest-plugin');
1818
var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
19+
var DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
1920
var paths = require('./paths');
2021
var getClientEnvironment = require('./env');
2122

@@ -259,6 +260,9 @@ module.exports = {
259260
screw_ie8: true
260261
}
261262
}),
263+
// Warn about duplicate dependencies.
264+
// See https://github.com/facebookincubator/create-react-app/issues/1844
265+
new DuplicatePackageCheckerPlugin(),
262266
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
263267
new ExtractTextPlugin(cssFilename),
264268
// Generate a manifest file which contains a mapping of all asset filenames

packages/react-scripts/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"css-loader": "0.26.1",
3838
"detect-port": "1.1.0",
3939
"dotenv": "2.0.0",
40+
"duplicate-package-checker-webpack-plugin": "^1.2.4",
4041
"eslint": "3.16.1",
4142
"eslint-config-react-app": "^0.6.2",
4243
"eslint-loader": "1.6.0",

0 commit comments

Comments
 (0)