Skip to content

Commit 8076567

Browse files
harunhasdalgaearon
authored andcommitted
Remove path module from webpack config on eject. (facebook#1175)
* Remove path module from webpack config on eject. Fixes facebook#1174 * Move path module inclusion right after the other imports Re: facebook#1174
1 parent f7d9cd8 commit 8076567

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/react-scripts/config/webpack.config.dev.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010
// @remove-on-eject-end
1111

12-
var path = require('path');
1312
var autoprefixer = require('autoprefixer');
1413
var webpack = require('webpack');
1514
var HtmlWebpackPlugin = require('html-webpack-plugin');
@@ -19,6 +18,11 @@ var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeMod
1918
var getClientEnvironment = require('./env');
2019
var paths = require('./paths');
2120

21+
// @remove-on-eject-begin
22+
// `path` is not used after eject - see https://github.com/facebookincubator/create-react-app/issues/1174
23+
var path = require('path');
24+
// @remove-on-eject-end
25+
2226
// Webpack uses `publicPath` to determine where the app is being served from.
2327
// In development, we always serve from the root. This makes config easier.
2428
var publicPath = '/';

packages/react-scripts/config/webpack.config.prod.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010
// @remove-on-eject-end
1111

12-
var path = require('path');
1312
var autoprefixer = require('autoprefixer');
1413
var webpack = require('webpack');
1514
var HtmlWebpackPlugin = require('html-webpack-plugin');
@@ -20,6 +19,11 @@ var url = require('url');
2019
var paths = require('./paths');
2120
var getClientEnvironment = require('./env');
2221

22+
// @remove-on-eject-begin
23+
// `path` is not used after eject - see https://github.com/facebookincubator/create-react-app/issues/1174
24+
var path = require('path');
25+
// @remove-on-eject-end
26+
2327
function ensureSlash(path, needsSlash) {
2428
var hasSlash = path.endsWith('/');
2529
if (hasSlash && !needsSlash) {

0 commit comments

Comments
 (0)