File tree 1 file changed +20
-12
lines changed
1 file changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -2,17 +2,25 @@ var express = require('express');
2
2
var webpack = require ( 'webpack' ) ;
3
3
var makeWebpackConfig = require ( '../src/make-webpack-config.js' ) ;
4
4
var env = global . MODE || process . env . NODE_ENV ;
5
- var compiler = webpack ( makeWebpackConfig ( env ) ) ;
5
+ var config = require ( '../src/utils/config' ) ;
6
6
7
- if ( env === 'development' ) {
8
- global . app . use ( require ( 'webpack-dev-middleware' ) ( compiler , {
9
- noInfo : true
10
- } ) ) ;
11
- global . app . use ( require ( 'webpack-hot-middleware' ) ( compiler ) ) ;
12
- } else {
13
- webpack ( makeWebpackConfig ( 'production' ) , function ( err , stats ) {
14
- if ( err ) {
15
- console . log ( err , stats ) ;
16
- }
17
- } ) ;
7
+ if ( config . enabled ) {
8
+ var compiler = webpack ( makeWebpackConfig ( env ) ) ;
9
+
10
+ if ( env === 'development' ) {
11
+ global . app . use ( require ( 'webpack-dev-middleware' ) ( compiler , {
12
+ noInfo : true
13
+ } ) ) ;
14
+ global . app . use ( require ( 'webpack-hot-middleware' ) ( compiler ) ) ;
15
+ } else {
16
+ console . log ( 'webpack building production styleguidist bundle...' ) ;
17
+
18
+ webpack ( makeWebpackConfig ( 'production' ) , function ( err , stats ) {
19
+ if ( err ) {
20
+ console . log ( err , stats ) ;
21
+ }
22
+
23
+ console . log ( 'webpack production styleguidist build done' ) ;
24
+ } ) ;
25
+ }
18
26
}
You can’t perform that action at this time.
0 commit comments