Skip to content

Commit

Permalink
Warn about duplicate dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenscerri committed Mar 22, 2017
1 parent f16eb95 commit d6486d8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
var CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
var DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
var getClientEnvironment = require('./env');
var paths = require('./paths');

Expand Down Expand Up @@ -224,6 +225,9 @@ module.exports = {
// a plugin that prints an error when you attempt to do this.
// See https://github.com/facebookincubator/create-react-app/issues/240
new CaseSensitivePathsPlugin(),
// Warn about duplicate dependencies.
// See https://github.com/facebookincubator/create-react-app/issues/1844
new DuplicatePackageCheckerPlugin(),
// If you require a missing module and then `npm install` it, you still have
// to restart the development server for Webpack to discover it. This plugin
// makes the discovery automatic so you don't have to restart.
Expand Down
4 changes: 4 additions & 0 deletions packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var ManifestPlugin = require('webpack-manifest-plugin');
var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
var DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
var paths = require('./paths');
var getClientEnvironment = require('./env');

Expand Down Expand Up @@ -259,6 +260,9 @@ module.exports = {
screw_ie8: true
}
}),
// Warn about duplicate dependencies.
// See https://github.com/facebookincubator/create-react-app/issues/1844
new DuplicatePackageCheckerPlugin(),
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
new ExtractTextPlugin(cssFilename),
// Generate a manifest file which contains a mapping of all asset filenames
Expand Down
1 change: 1 addition & 0 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"css-loader": "0.26.1",
"detect-port": "1.1.0",
"dotenv": "2.0.0",
"duplicate-package-checker-webpack-plugin": "^1.2.4",
"eslint": "3.16.1",
"eslint-config-react-app": "^0.6.2",
"eslint-loader": "1.6.0",
Expand Down

0 comments on commit d6486d8

Please sign in to comment.