@@ -214,6 +214,8 @@ function parseAsset(scripts: any, styles: any, asset: Asset | undefined | null,
214214}
215215
216216export class AssetLoader {
217+ private stylePoints = new Map < string , StylePoint > ( ) ;
218+
217219 async load ( asset : Asset ) {
218220 const styles : any = { } ;
219221 const scripts : any = { } ;
@@ -237,11 +239,9 @@ export class AssetLoader {
237239 await Promise . all (
238240 styleQueue . map ( ( { content, level, type, id } ) => this . loadStyle ( content , level ! , type === AssetType . CSSUrl , id ) ) ,
239241 ) ;
240- await Promise . all ( scriptQueue . map ( ( { content, type } ) => this . loadScript ( content , type === AssetType . JSUrl ) ) ) ;
242+ await Promise . all ( scriptQueue . map ( ( { content, type, scriptType } ) => this . loadScript ( content , type === AssetType . JSUrl , scriptType ) ) ) ;
241243 }
242244
243- private stylePoints = new Map < string , StylePoint > ( ) ;
244-
245245 private loadStyle ( content : string | undefined | null , level : AssetLevel , isUrl ?: boolean , id ?: string ) {
246246 if ( ! content ) {
247247 return ;
@@ -259,11 +259,11 @@ export class AssetLoader {
259259 return isUrl ? point . applyUrl ( content ) : point . applyText ( content ) ;
260260 }
261261
262- private loadScript ( content : string | undefined | null , isUrl ?: boolean ) {
262+ private loadScript ( content : string | undefined | null , isUrl ?: boolean , scriptType ?: string ) {
263263 if ( ! content ) {
264264 return ;
265265 }
266- return isUrl ? load ( content ) : evaluate ( content ) ;
266+ return isUrl ? load ( content , scriptType ) : evaluate ( content , scriptType ) ;
267267 }
268268
269269 // todo 补充类型
0 commit comments