File tree 2 files changed +3
-5
lines changed
2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ var loaderSchema = require('./schema/loader-schema');
15
15
var pluginSchema = require ( './schema/plugin-schema.json' ) ;
16
16
17
17
var NS = fs . realpathSync ( __dirname ) ;
18
- var DEV = process . env . NODE_ENV === 'development' ;
19
18
var nextId = 0 ;
20
19
21
20
function ExtractTextPluginCompilation ( ) {
@@ -108,7 +107,7 @@ function ExtractTextPlugin(options) {
108
107
} else {
109
108
schemaTester ( pluginSchema , options ) ;
110
109
}
111
- this . filename = options . filename || ( DEV ? '[name].css' : '[name].[contenthash].css' ) ;
110
+ this . filename = options . filename || ( process . env . NODE_ENV === 'development' ? '[name].css' : '[name].[contenthash].css' ) ;
112
111
this . id = options . id != null ? options . id : ++ nextId ;
113
112
this . options = { } ;
114
113
mergeOptions ( this . options , options ) ;
@@ -292,7 +291,7 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
292
291
293
292
// HMR: inject file name into corresponding javascript modules in order to trigger
294
293
// appropriate hot module reloading of CSS
295
- if ( DEV ) {
294
+ if ( process . env . NODE_ENV === 'development' ) {
296
295
compilation . plugin ( "before-chunk-assets" , function ( ) {
297
296
extractedChunks . forEach ( function ( extractedChunk ) {
298
297
extractedChunk . modules . forEach ( function ( module ) {
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ var SingleEntryPlugin = require("webpack/lib/SingleEntryPlugin");
13
13
var LimitChunkCountPlugin = require ( "webpack/lib/optimize/LimitChunkCountPlugin" ) ;
14
14
15
15
var NS = fs . realpathSync ( __dirname ) ;
16
- var DEV = process . env . NODE_ENV === 'development'
17
16
18
17
module . exports = function ( source ) {
19
18
return source ;
@@ -133,7 +132,7 @@ module.exports.pitch = function(request) {
133
132
//
134
133
// All we need is a date that changes during dev, to trigger a reload since
135
134
// hashes generated based on the file contents are what trigger HMR.
136
- if ( DEV ) {
135
+ if ( process . env . NODE_ENV === 'development' ) {
137
136
resultSource += `
138
137
if (module.hot) {
139
138
module.hot.accept();
You can’t perform that action at this time.
0 commit comments