File tree Expand file tree Collapse file tree 4 files changed +23
-8
lines changed Expand file tree Collapse file tree 4 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -307,10 +307,12 @@ exports.run = function (options) {
307
307
nextConfig = extend ( { } , config ) ;
308
308
309
309
// 注入 sockitIO
310
- nextConfig . module . postLoaders . push ( {
311
- test : / \. ( j s ) $ / ,
312
- loader : sysPath . join ( __dirname , '../modules/SocketClientLoader.js?cacheId=' + cacheId )
313
- } ) ;
310
+ if ( project . server && project . server . overlay ) {
311
+ nextConfig . module . postLoaders . push ( {
312
+ test : / \. ( j s ) $ / ,
313
+ loader : sysPath . join ( __dirname , '../modules/SocketClientLoader.js?cacheId=' + cacheId )
314
+ } ) ;
315
+ }
314
316
315
317
if ( shouldCompileAllEntries ) {
316
318
return nextConfig ;
Original file line number Diff line number Diff line change @@ -99,6 +99,11 @@ var Project = function () {
99
99
value : function setProxy ( proxy ) {
100
100
this . proxy = proxy || [ ] ;
101
101
}
102
+ } , {
103
+ key : 'setServer' ,
104
+ value : function setServer ( server ) {
105
+ this . server = server || { } ;
106
+ }
102
107
} , {
103
108
key : 'readConfig' ,
104
109
value : function readConfig ( ) {
@@ -208,6 +213,7 @@ var Project = function () {
208
213
this . setCommands ( ykitConfigFile . commands || ykitConfigFile . config . command ) ; // 后者兼容以前形式
209
214
this . setHooks ( ykitConfigFile . hooks ) ;
210
215
this . setProxy ( ykitConfigFile . proxy ) ;
216
+ this . setServer ( ykitConfigFile . server ) ;
211
217
} else {
212
218
logError ( 'Local ' + this . configFile + ' config not found.' ) ;
213
219
logDoc ( 'http://ued.qunar.com/ykit/docs-配置.html' ) ;
Original file line number Diff line number Diff line change @@ -303,10 +303,12 @@ exports.run = (options) => {
303
303
nextConfig = extend ( { } , config ) ;
304
304
305
305
// 注入 sockitIO
306
- nextConfig . module . postLoaders . push ( {
307
- test : / \. ( j s ) $ / ,
308
- loader : sysPath . join ( __dirname , '../modules/SocketClientLoader.js?cacheId=' + cacheId )
309
- } ) ;
306
+ if ( project . server && project . server . overlay ) {
307
+ nextConfig . module . postLoaders . push ( {
308
+ test : / \. ( j s ) $ / ,
309
+ loader : sysPath . join ( __dirname , '../modules/SocketClientLoader.js?cacheId=' + cacheId )
310
+ } ) ;
311
+ }
310
312
311
313
if ( shouldCompileAllEntries ) {
312
314
return nextConfig ;
Original file line number Diff line number Diff line change @@ -94,6 +94,10 @@ class Project {
94
94
this . proxy = proxy || [ ] ;
95
95
}
96
96
97
+ setServer ( server ) {
98
+ this . server = server || { } ;
99
+ }
100
+
97
101
readConfig ( ) {
98
102
if ( ! this . configFile ) {
99
103
// no local config, i.e., server command)
@@ -203,6 +207,7 @@ class Project {
203
207
this . setCommands ( ykitConfigFile . commands || ykitConfigFile . config . command ) ; // 后者兼容以前形式
204
208
this . setHooks ( ykitConfigFile . hooks ) ;
205
209
this . setProxy ( ykitConfigFile . proxy ) ;
210
+ this . setServer ( ykitConfigFile . server ) ;
206
211
} else {
207
212
logError ( 'Local ' + this . configFile + ' config not found.' ) ;
208
213
logDoc ( 'http://ued.qunar.com/ykit/docs-配置.html' ) ;
You can’t perform that action at this time.
0 commit comments