feat: use import maps instead of deps files (#209)

This commit updates fresh to use import maps instead of deps files in generated projects.
This commit is contained in:
Luca Casonato
2022-05-23 19:35:15 +02:00
committed by GitHub
parent fd1346ed6b
commit 80598d07fd
71 changed files with 188 additions and 141 deletions
+4 -2
View File
@@ -21,11 +21,13 @@ async function ensureEsbuildInialized() {
}
export class Bundler {
#importMapURL: URL;
#islands: Island[];
#cache: Map<string, Uint8Array> | Promise<void> | undefined = undefined;
constructor(islands: Island[]) {
constructor(islands: Island[], importMapURL: URL) {
this.#islands = islands;
this.#importMapURL = importMapURL;
}
async bundle() {
@@ -52,7 +54,7 @@ export class Bundler {
absWorkingDir,
outfile: "",
platform: "neutral",
plugins: [denoPlugin()],
plugins: [denoPlugin({ importMapURL: this.#importMapURL })],
splitting: true,
target: ["chrome96", "firefox95", "safari14"],
treeShaking: true,