Add webpack resolve aliasing to dedupe packages installed through npm link

This commit is contained in:
Brett Sun 2016-06-24 13:46:09 +02:00
parent b598b428b4
commit 2ddb9ebd4a
1 changed files with 10 additions and 0 deletions

View File

@ -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
},