chore: clean up esbuild builder logic (#1231)
This will allow us to add various caches and similar around the esbuild builder easily in follow up PRs. It also makes doing an AOT build-step + load assets from disk much simpler.
This commit is contained in:
@@ -26,7 +26,7 @@ export interface RenderOptions<Data> {
|
||||
plugins: Plugin[];
|
||||
app: AppModule;
|
||||
imports: string[];
|
||||
dependencyMap: Map<string, string[]>;
|
||||
dependenciesFn: (path: string) => string[];
|
||||
url: URL;
|
||||
params: Record<string, string | string[]>;
|
||||
renderFn: RenderFunction;
|
||||
@@ -221,8 +221,8 @@ export async function render<Data>(
|
||||
const url = bundleAssetUrl(path);
|
||||
imports.push([url, randomNonce]);
|
||||
preloadSet.add(url);
|
||||
for (const depPath of opts.dependencyMap.get(path) ?? []) {
|
||||
const url = bundleAssetUrl(depPath);
|
||||
for (const depPath of opts.dependenciesFn(path)) {
|
||||
const url = bundleAssetUrl(`/${depPath}`);
|
||||
preloadSet.add(url);
|
||||
}
|
||||
return url;
|
||||
|
||||
Reference in New Issue
Block a user