mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-28 09:25:42 +08:00
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
This commit is contained in:
@@ -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 = '/';
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user