Skip to content

Commit

Permalink
Remove path module from webpack config on eject. (#1175)
Browse files Browse the repository at this point in the history
* Remove path module from webpack config on eject.

Fixes #1174

* Move path module inclusion right after the other imports

Re: #1174
  • Loading branch information
harunhasdal authored and gaearon committed Dec 6, 2016
1 parent f7d9cd8 commit 8076567
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/react-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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 = '/';
Expand Down
6 changes: 5 additions & 1 deletion packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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) {
Expand Down

0 comments on commit 8076567

Please sign in to comment.