Skip to content

Commit

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

Fixes facebook#1174

* Move path module inclusion right after the other imports

Re: facebook#1174
  • Loading branch information
harunhasdal authored and randycoulman committed May 8, 2017
1 parent b6ad925 commit 6df9012
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.
// ZEAL: Setting publicPath in the start script and passing it in. Since we are
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 6df9012

Please sign in to comment.