File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,9 @@ const webpack = require('webpack');
1717 * @return {void }
1818 */
1919module . exports = function ( plugins , webpackConfig ) {
20-
21- if ( ! webpackConfig . isProduction ( ) ) {
22- return ;
23- }
24-
2520 const definePluginOptions = {
2621 'process.env' : {
27- NODE_ENV : '"production"'
22+ NODE_ENV : webpackConfig . isProduction ( ) ? '"production"' : '"development "'
2823 }
2924 } ;
3025
Original file line number Diff line number Diff line change @@ -30,7 +30,9 @@ describe('plugins/define', () => {
3030 const plugins = [ ] ;
3131
3232 definePluginUtil ( plugins , config ) ;
33- expect ( plugins . length ) . to . equal ( 0 ) ;
33+ expect ( plugins . length ) . to . equal ( 1 ) ;
34+ expect ( plugins [ 0 ] ) . to . be . instanceof ( webpack . DefinePlugin ) ;
35+ expect ( plugins [ 0 ] . definitions [ 'process.env' ] . NODE_ENV ) . to . equal ( JSON . stringify ( 'development' ) ) ;
3436 } ) ;
3537
3638 it ( 'production environment with default settings' , ( ) => {
@@ -40,6 +42,7 @@ describe('plugins/define', () => {
4042 definePluginUtil ( plugins , config ) ;
4143 expect ( plugins . length ) . to . equal ( 1 ) ;
4244 expect ( plugins [ 0 ] ) . to . be . instanceof ( webpack . DefinePlugin ) ;
45+ expect ( plugins [ 0 ] . definitions [ 'process.env' ] . NODE_ENV ) . to . equal ( JSON . stringify ( 'production' ) ) ;
4346 } ) ;
4447
4548 it ( 'production environment with options callback' , ( ) => {
You can’t perform that action at this time.
0 commit comments