From 13067b598d168d0bc5c9588c6a159f867f2672b2 Mon Sep 17 00:00:00 2001 From: Harun Date: Tue, 6 Dec 2016 11:17:18 +0000 Subject: [PATCH] Remove path module from webpack config on eject. (#1175) * Remove path module from webpack config on eject. Fixes #1174 * Move path module inclusion right after the other imports Re: #1174 --- packages/react-scripts/config/webpack.config.dev.js | 6 +++++- packages/react-scripts/config/webpack.config.prod.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index 8e264d40286..bd8db711a0c 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -9,7 +9,6 @@ */ // @remove-on-eject-end -var path = require('path'); var autoprefixer = require('autoprefixer'); var webpack = require('webpack'); var HtmlWebpackPlugin = require('html-webpack-plugin'); @@ -19,6 +18,11 @@ var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeMod var getClientEnvironment = require('./env'); var paths = require('./paths'); +// @remove-on-eject-begin +// `path` is not used after eject - see https://github.com/facebookincubator/create-react-app/issues/1174 +var path = require('path'); +// @remove-on-eject-end + // Webpack uses `publicPath` to determine where the app is being served from. // In development, we always serve from the root. This makes config easier. var publicPath = '/'; diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 60016896892..bae24d1a46d 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -9,7 +9,6 @@ */ // @remove-on-eject-end -var path = require('path'); var autoprefixer = require('autoprefixer'); var webpack = require('webpack'); var HtmlWebpackPlugin = require('html-webpack-plugin'); @@ -20,6 +19,11 @@ var url = require('url'); var paths = require('./paths'); var getClientEnvironment = require('./env'); +// @remove-on-eject-begin +// `path` is not used after eject - see https://github.com/facebookincubator/create-react-app/issues/1174 +var path = require('path'); +// @remove-on-eject-end + function ensureSlash(path, needsSlash) { var hasSlash = path.endsWith('/'); if (hasSlash && !needsSlash) {