From 2ddb9ebd4a5def1d726a3619a5ac74bc0a6c391e Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Fri, 24 Jun 2016 13:46:09 +0200 Subject: [PATCH] Add webpack resolve aliasing to dedupe packages installed through npm link --- webpack.config.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index bd5acb04..b10142f8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -209,6 +209,16 @@ const config = { devtool: PRODUCTION ? '#source-map' : '#inline-source-map', resolve: { + // Dedupe any dependencies' polyfill, react, or react-css-modules dependencies when + // developing with npm link + alias: { + 'babel-runtime': path.resolve(PATHS.NODE_MODULES, 'babel-runtime'), + 'core-js': path.resolve(PATHS.NODE_MODULES, 'core-js'), + 'js-utility-belt': path.resolve(PATHS.NODE_MODULES, 'js-utility-belt'), + 'react': path.resolve(PATHS.NODE_MODULES, 'react'), + 'react-dom': path.resolve(PATHS.NODE_MODULES, 'react-dom'), + 'react-css-modules': path.resolve(PATHS.NODE_MODULES, 'react-css-modules'), + }, extensions: ['', '.js', '.jsx'], modules: ['node_modules'], // Don't use absolute path here to allow recursive matching },