Skip to content

Commit

Permalink
fix: Separate template builds to prevent sharing chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 committed Jul 3, 2023
1 parent 37986bf commit 7f3a1e8
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,17 @@ await Promise.all([
dts: true,
silent: true,
}),
...clientTemplates.map((templateName) =>
tsup.build({
entry: clientTemplates.reduce<Record<string, string>>(
(entry, templateName) => {
entry[
`templates/virtual-${templateName}`
] = `src/client/templates/virtual-${templateName}.ts`;
return entry;
entry: {
[`templates/virtual-${templateName}`]: `src/client/templates/virtual-${templateName}.ts`,
},
{},
),
format: ['esm'],
sourcemap: true,
silent: true,
external: clientTemplates.map(
(templateName) => `virtual:user-${templateName}`,
external: [`virtual:user-${templateName}`],
}),
),
}),
]).catch((err) => {
spinner.fail();
console.error(err);
Expand Down

0 comments on commit 7f3a1e8

Please sign in to comment.