Skip to content

Commit f982db7

Browse files
committed
Fixed another query of DEV environment
1 parent 8d16ea2 commit f982db7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ var loaderSchema = require('./schema/loader-schema');
1515
var pluginSchema = require('./schema/plugin-schema.json');
1616

1717
var NS = fs.realpathSync(__dirname);
18-
var DEV = process.env.NODE_ENV === 'development';
1918
var nextId = 0;
2019

2120
function ExtractTextPluginCompilation() {
@@ -108,7 +107,7 @@ function ExtractTextPlugin(options) {
108107
} else {
109108
schemaTester(pluginSchema, options);
110109
}
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');
112111
this.id = options.id != null ? options.id : ++nextId;
113112
this.options = {};
114113
mergeOptions(this.options, options);
@@ -292,7 +291,7 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
292291

293292
// HMR: inject file name into corresponding javascript modules in order to trigger
294293
// appropriate hot module reloading of CSS
295-
if (DEV) {
294+
if (process.env.NODE_ENV === 'development') {
296295
compilation.plugin("before-chunk-assets", function() {
297296
extractedChunks.forEach(function(extractedChunk) {
298297
extractedChunk.modules.forEach(function(module) {

0 commit comments

Comments
 (0)