@@ -67,11 +67,10 @@ const exec = exports.exec = function(resource, map, rule, emitter) {
67
67
return $0 ;
68
68
}
69
69
70
- // original id may be changed, but getModuleIDByOrigin
71
- // still record the old path as module Id.
72
- let originalModuleId = resource . getModuleIDByOrigin ( $1 ) ;
73
- let inlineResource = map . getResource ( 'JS' , originalModuleId ) ||
74
- map . getResourceByPath ( originalModuleId ) ;
70
+ // original id may be changed, but getModulePathByOrigin
71
+ // still record the old module's path.
72
+ let modulePath = resource . getModulePathByOrigin ( $1 ) ;
73
+ let inlineResource = map . getResourceByPath ( modulePath ) ;
75
74
76
75
if ( inlineResource ) {
77
76
if ( ! inlineResource . isCompiled ) {
@@ -89,8 +88,10 @@ const exec = exports.exec = function(resource, map, rule, emitter) {
89
88
}
90
89
return $0 . replace ( $1 , inlineResource . id ) ;
91
90
} else {
92
- soi . log . warn ( 'JS file refer to [' + $1 + '] in file [' +
93
- resource . path + '] Not found' ) ;
91
+ soi . log . error (
92
+ `JS file refer to [${ $1 } ] in file [${ resource . path } ] Not found`
93
+ ) ;
94
+ process . exit ( 0 ) ;
94
95
}
95
96
96
97
return $0 ;
@@ -108,20 +109,21 @@ const exec = exports.exec = function(resource, map, rule, emitter) {
108
109
return ;
109
110
}
110
111
111
- // original id may be changed, but getModuleIDByOrigin
112
- // still record the old path as module Id.
113
- let originalModuleId = resource . getModuleIDByOrigin ( dep ) ;
114
- let inlineResource = map . getResource ( 'JS' , originalModuleId ) ||
115
- map . getResourceByPath ( originalModuleId ) ;
112
+ // original id may be changed, but getModulePathByOrigin
113
+ // still record the old module's path.
114
+ let originalModuleId = resource . getModulePathByOrigin ( dep ) ;
115
+ let inlineResource = map . getResourceByPath ( originalModuleId ) ;
116
116
117
117
if ( inlineResource ) {
118
118
if ( ! inlineResource . isCompiled ) {
119
119
exec ( inlineResource , map , rule , emitter ) ;
120
120
}
121
121
ret . push ( '"' + inlineResource . id + '"' ) ;
122
122
} else {
123
- soi . log . warn ( 'JS file refer to [' + $1 + '] in file [' +
124
- resource . path + '] Not found' ) ;
123
+ soi . log . error (
124
+ `JS file refer to [${ $1 } ] in file [${ resource . path } ] Not found`
125
+ ) ;
126
+ process . exit ( 0 ) ;
125
127
}
126
128
} ) ;
127
129
0 commit comments