Skip to content

Commit

Permalink
fix(browser-vm): new JavaScriptManager for jsonpScript
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoushaw committed Oct 14, 2021
1 parent 36f30b2 commit 42277fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/loader/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SyncHook, SyncWaterfallHook, PluginSystem } from '@garfish/hooks';
import { warn, isJs, isCss, isHtml, __LOADER_FLAG__ } from '@garfish/utils';
import { warn, isJs, isCss, isHtml, __LOADER_FLAG__, maybeIsJsonpScript } from '@garfish/utils';
import { StyleManager } from './managers/style';
import { ModuleManager } from './managers/module';
import { TemplateManager } from './managers/template';
Expand Down Expand Up @@ -135,7 +135,7 @@ export class Loader {
} else if (isHtml(mimeType) || /\.html/.test(result.url)) {
fileType = FileTypes.template;
managerCtor = TemplateManager;
} else if (isJs(mimeType) || /\.js/.test(result.url)) {
} else if (isJs(mimeType) || /\.js/.test(result.url) || maybeIsJsonpScript(mimeType,result.url)) {
fileType = FileTypes.js;
managerCtor = JavaScriptManager;
} else if (isCss(mimeType) || /\.css/.test(result.url)) {
Expand Down

0 comments on commit 42277fe

Please sign in to comment.