-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
分离importmap到importmap.js,并用text/javascript类型加载。
使用“module”加载时会“External import maps”错误 @see WICG/import-maps#235 @see https://www.jianshu.com/p/b23d823a183a
- Loading branch information
1 parent
52426a2
commit c43fc59
Showing
2 changed files
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
projects/try-web-without-frame/WebGL编程指南/WebGL入门/最短的WebGL程序:清空绘图区/importmap.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const script = document.createElement("script"); | ||
script.type = "importmap"; | ||
script.textContent = JSON.stringify({ | ||
imports: { | ||
Canvas: "./Canvas.js", | ||
}, | ||
}); | ||
document.currentScript.after(script); |