File tree Expand file tree Collapse file tree 3 files changed +27
-22
lines changed Expand file tree Collapse file tree 3 files changed +27
-22
lines changed Original file line number Diff line number Diff line change @@ -227,17 +227,19 @@ exports.run = function (options) {
227
227
if ( Object . keys ( nextConfig . entry ) . length === 0 ) {
228
228
// 如果是js入口没找到,那肯定是出错了,这时候应该直接next让后面报错
229
229
if ( req . url . match ( / \. j s $ / ) ) {
230
- next ( ) ;
230
+ res . writeHead ( 200 , { 'Content-Type' : 'text/html' } ) ;
231
+ res . end ( '[ykit] - js入口未找到,请检查项目' + projectName + '的ykit配置文件.' ) ;
232
+ } else {
233
+ setTimeout ( function ( ) {
234
+ promiseCache [ projectName ] ? Promise . all ( promiseCache [ projectName ] ) . then ( function ( ) {
235
+ // 统一去掉版本号
236
+ req . url = req . url . replace ( / @ [ \d \w ] + (? = \. \w + $ ) / , '' ) ;
237
+ next ( ) ;
238
+ } ) . catch ( function ( err ) {
239
+ throw err ;
240
+ } ) : null ;
241
+ } , 1000 ) ;
231
242
}
232
- setTimeout ( function ( ) {
233
- promiseCache [ projectName ] ? Promise . all ( promiseCache [ projectName ] ) . then ( function ( ) {
234
- // 统一去掉版本号
235
- req . url = req . url . replace ( / @ [ \d \w ] + (? = \. \w + $ ) / , '' ) ;
236
- next ( ) ;
237
- } ) . catch ( function ( err ) {
238
- throw err ;
239
- } ) : null ;
240
- } , 1000 ) ;
241
243
} else {
242
244
( function ( ) {
243
245
// 生成该请求的 promiseCache
Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ var Project = function () {
172
172
}
173
173
} ) ;
174
174
}
175
+
175
176
this . config . setExports ( exports ) ;
176
177
this . config . setCompiler ( userConfigObj . modifyWebpackConfig ) ;
177
178
this . config . setSync ( userConfigObj . sync ) ;
Original file line number Diff line number Diff line change @@ -224,19 +224,21 @@ exports.run = (options) => {
224
224
if ( Object . keys ( nextConfig . entry ) . length === 0 ) {
225
225
// 如果是js入口没找到,那肯定是出错了,这时候应该直接next让后面报错
226
226
if ( req . url . match ( / \. j s $ / ) ) {
227
- next ( ) ;
227
+ res . writeHead ( 200 , { 'Content-Type' : 'text/html' } ) ;
228
+ res . end ( '[ykit] - js入口未找到,请检查项目' + projectName + '的ykit配置文件.' ) ;
229
+ } else {
230
+ setTimeout ( ( ) => {
231
+ promiseCache [ projectName ] ?
232
+ Promise . all ( promiseCache [ projectName ] ) . then ( ( ) => {
233
+ // 统一去掉版本号
234
+ req . url = req . url . replace ( / @ [ \d \w ] + (? = \. \w + $ ) / , '' ) ;
235
+ next ( ) ;
236
+ } ) . catch ( ( err ) => {
237
+ throw err ;
238
+ } ) :
239
+ null ;
240
+ } , 1000 ) ;
228
241
}
229
- setTimeout ( ( ) => {
230
- promiseCache [ projectName ] ?
231
- Promise . all ( promiseCache [ projectName ] ) . then ( ( ) => {
232
- // 统一去掉版本号
233
- req . url = req . url . replace ( / @ [ \d \w ] + (? = \. \w + $ ) / , '' ) ;
234
- next ( ) ;
235
- } ) . catch ( ( err ) => {
236
- throw err ;
237
- } ) :
238
- null ;
239
- } , 1000 ) ;
240
242
} else {
241
243
// 生成该请求的 promiseCache
242
244
let resolve = null ;
You can’t perform that action at this time.
0 commit comments