chore: Rename templates to virtual-modules (#24)

This commit is contained in:
Aaron
2023-07-02 21:49:01 -05:00
committed by GitHub
parent e14f81d97a
commit 75eb3de89e
7 changed files with 8 additions and 8 deletions
+5 -5
View File
@@ -11,7 +11,7 @@ const spinner = ora('Building WXT').start();
const startTime = Date.now();
const outDir = 'dist';
const clientTemplates = ['background', 'content-script'];
const virtualEntrypoints = ['background', 'content-script'];
await fs.rm(outDir, { recursive: true, force: true });
@@ -38,20 +38,20 @@ await Promise.all([
dts: true,
silent: true,
}),
...clientTemplates.map((templateName) =>
...virtualEntrypoints.map((entryName) =>
tsup.build({
entry: {
[`templates/virtual-${templateName}`]: `src/client/templates/virtual-${templateName}.ts`,
[`virtual-modules/${entryName}-entrypoint`]: `src/client/virtual-modules/${entryName}-entrypoint.ts`,
},
format: ['esm'],
sourcemap: true,
silent: true,
external: [`virtual:user-${templateName}`],
external: [`virtual:user-${entryName}`],
}),
),
tsup.build({
entry: {
'templates/reload-html': `src/client/templates/reload-html.ts`,
'virtual-modules/reload-html': `src/client/virtual-modules/reload-html.ts`,
},
format: ['esm'],
sourcemap: true,