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:
@@ -0,0 +1,23 @@
|
||||
export {
|
||||
EsbuildBuilder,
|
||||
type EsbuildBuilderOptions,
|
||||
EsbuildSnapshot,
|
||||
type JSXConfig,
|
||||
} from "./esbuild.ts";
|
||||
export interface Builder {
|
||||
build(): Promise<BuildSnapshot>;
|
||||
}
|
||||
|
||||
export interface BuildSnapshot {
|
||||
/** The list of files contained in this snapshot, not prefixed by a slash. */
|
||||
readonly paths: string[];
|
||||
|
||||
/** For a given file, return it's contents.
|
||||
* @throws If the file is not contained in this snapshot. */
|
||||
read(path: string): ReadableStream<Uint8Array> | Uint8Array | null;
|
||||
|
||||
/** For a given entrypoint, return it's list of dependencies.
|
||||
*
|
||||
* Returns an empty array if the entrypoint does not exist. */
|
||||
dependencies(path: string): string[];
|
||||
}
|
||||
Reference in New Issue
Block a user