9
9
*/
10
10
// @remove -on-eject-end
11
11
'use strict' ;
12
+ process . env . NODE_ENV = 'development' ;
12
13
const autoprefixer = require ( 'autoprefixer' ) ;
13
14
const webpack = require ( 'webpack' ) ;
14
15
const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
@@ -17,7 +18,6 @@ const ManifestPlugin = require('webpack-manifest-plugin');
17
18
const InterpolateHtmlPlugin = require ( 'react-dev-utils/InterpolateHtmlPlugin' ) ;
18
19
const paths = require ( './paths' ) ;
19
20
const getClientEnvironment = require ( './env' ) ;
20
- const isProduction = require ( 'react-dev-utils/isProduction' ) ;
21
21
22
22
// @remove -on-eject-begin
23
23
// `path` is not used after eject - see https://github.com/facebookincubator/create-react-app/issues/1174
@@ -61,7 +61,7 @@ const extractTextPluginOptions = shouldUseRelativeAssetPaths
61
61
module . exports = {
62
62
watch : true ,
63
63
context : paths . appSrc ,
64
- devtool : isProduction ( ) ? 'source-map' : 'cheap-module-source-map' ,
64
+ devtool : 'cheap-module-source-map' ,
65
65
// There are no support for live reloading changes in this mode
66
66
entry : [ require . resolve ( './polyfills' ) , paths . appIndexJs ] ,
67
67
output : {
@@ -125,7 +125,7 @@ module.exports = {
125
125
options : {
126
126
// TODO: consider separate config for production,
127
127
// e.g. to enable no-console and no-debugger only in production.
128
- configFile : path . join ( __dirname , '../. eslintrc' ) ,
128
+ configFile : path . join ( __dirname , '../eslintrc' ) ,
129
129
useEslintrc : false ,
130
130
} ,
131
131
// @remove -on-eject-end
@@ -239,44 +239,12 @@ module.exports = {
239
239
new HtmlWebpackPlugin ( {
240
240
inject : true ,
241
241
template : paths . appHtml ,
242
- minify : isProduction ( )
243
- ? // Minify the code if in production.
244
- {
245
- removeComments : true ,
246
- collapseWhitespace : true ,
247
- removeRedundantAttributes : true ,
248
- useShortDoctype : true ,
249
- removeEmptyAttributes : true ,
250
- removeStyleLinkTypeAttributes : true ,
251
- keepClosingSlash : true ,
252
- minifyJS : true ,
253
- minifyCSS : true ,
254
- minifyURLs : true ,
255
- }
256
- : false ,
257
242
} ) ,
258
243
// Makes some environment variables available to the JS code, for example:
259
244
// if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`.
260
245
// It is absolutely essential that NODE_ENV was set to production here.
261
246
// Otherwise React will be compiled in the very slow development mode.
262
247
new webpack . DefinePlugin ( env . stringified ) ,
263
- // Minify js if in production.
264
- isProduction ( )
265
- ? new webpack . optimize . UglifyJsPlugin ( {
266
- compress : {
267
- screw_ie8 : true , // React doesn't support IE8
268
- warnings : false ,
269
- } ,
270
- mangle : {
271
- screw_ie8 : true ,
272
- } ,
273
- output : {
274
- comments : false ,
275
- screw_ie8 : true ,
276
- } ,
277
- sourceMap : true ,
278
- } )
279
- : false ,
280
248
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
281
249
new ExtractTextPlugin ( {
282
250
filename : cssFilename ,
@@ -288,7 +256,7 @@ module.exports = {
288
256
new ManifestPlugin ( {
289
257
fileName : 'asset-manifest.json' ,
290
258
} ) ,
291
- ] . filter ( Boolean ) , // remove falsy plugin on development
259
+ ] ,
292
260
// Some libraries import Node modules but don't use them in the browser.
293
261
// Tell Webpack to provide empty mocks for them so importing them works.
294
262
node : {
0 commit comments