File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -113,12 +113,10 @@ export default class WxaCompiler {
113
113
} ) ;
114
114
}
115
115
116
- if ( ! rstTypeObject . src ) {
117
- let opath = path . parse ( filepath ) ;
118
-
119
-
120
- rstTypeObject . src = opath . dir + path . sep + opath . name + '.' + rstTypeObject . type ;
121
- }
116
+ // if (!rstTypeObject.src) {
117
+ // }
118
+ let opath = path . parse ( filepath ) ;
119
+ rstTypeObject . src = opath . dir + path . sep + opath . name + '.' + rstTypeObject . type ;
122
120
123
121
rstTypeObject . $from = filepath ;
124
122
Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ export default class Optimizer {
37
37
}
38
38
39
39
async do ( dep , indexedMap ) {
40
+ if ( ! dep . src ) {
41
+ // deadcode normally
42
+ debugger ;
43
+ return ;
44
+ }
40
45
const text = path . relative ( this . cwd , dep . src ) ;
41
46
this . progress . draw ( text , 'Optimizing' , ! this . cmdOptions . verbose ) ;
42
47
switch ( this . wxaConfigs . target ) {
Original file line number Diff line number Diff line change @@ -118,12 +118,12 @@ class Schedule {
118
118
119
119
async $doDPA ( ) {
120
120
let tasks = [ ] ;
121
- // while (this.$depPending.length) {
121
+ while ( this . $depPending . length ) {
122
122
let dep = this . $depPending . shift ( ) ;
123
123
124
124
// debug('file to parse %O', dep);
125
125
tasks . push ( this . $parse ( dep ) ) ;
126
- // }
126
+ }
127
127
128
128
let succ = await Promise . all ( tasks ) ;
129
129
@@ -331,7 +331,7 @@ class Schedule {
331
331
child = indexedModule ;
332
332
}
333
333
334
- if ( child . color !== COLOR . COMPILED ) this . $depPending . push ( child ) ;
334
+ if ( ~ [ COLOR . CHANGED , COLOR . COMPILE_ERROR , COLOR . INIT ] . indexOf ( child . color ) ) this . $depPending . push ( child ) ;
335
335
if ( child . color === COLOR . INIT ) this . $indexOfModule . set ( child . src , child ) ;
336
336
337
337
return child ;
You can’t perform that action at this time.
0 commit comments