From 0d6e77c9b967df4ba56910c3fe7c4790839dc5cb Mon Sep 17 00:00:00 2001 From: Andrew Luca Date: Fri, 5 Jan 2018 12:24:47 +0200 Subject: [PATCH] Stop webpack from resolving symlinks Webpack will not resolve symlinks to real folders This allows to symlink into 'src' folder https://github.com/facebookincubator/create-react-app/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+symlinks fixes: #3547 and others... --- packages/react-scripts/config/webpack.config.dev.js | 4 ++++ packages/react-scripts/config/webpack.config.prod.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index 9f3131b0660..03e6b7ad4ca 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -76,6 +76,10 @@ module.exports = { path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'), }, resolve: { + // This will tell webpack to not resolve symlinks to actual folders + // Symlinks into `src` folder will work with this option + // default value is set to `true` + symlinks: false, // This allows you to set a fallback for where Webpack should look for modules. // We placed these paths second because we want `node_modules` to "win" // if there are any conflicts. This matches Node resolution mechanism. diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 3b2a2068db2..fb0451102a2 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -82,6 +82,10 @@ module.exports = { .replace(/\\/g, '/'), }, resolve: { + // This will tell webpack to not resolve symlinks to actual folders + // Symlinks into `src` folder will work with this option + // default value is set to `true` + symlinks: false, // This allows you to set a fallback for where Webpack should look for modules. // We placed these paths second because we want `node_modules` to "win" // if there are any conflicts. This matches Node resolution mechanism.