Add path aliases
Some checks failed
Ruby Police / lint_and_check_types (push) Has been cancelled
JavaScript Police / lint_and_check_types (push) Has been cancelled

This commit is contained in:
Reese Armstrong 2024-09-20 13:47:50 +00:00
commit edc7c48f6a

View file

@ -40,6 +40,7 @@ class Builder {
ssr: boolean
workingDir: string
preprocess: object
pathAliases?: object[]
constructor (
path: string,
@ -49,7 +50,8 @@ class Builder {
server: string | null,
ssr: boolean,
workingDir: string,
preprocess: object
preprocess: object,
pathAliases?: object[]
) {
this.path = path
this.props = readable(Object.assign(props, locals, props))
@ -61,6 +63,7 @@ class Builder {
this.ssr = ssr
this.workingDir = workingDir
this.preprocess = preprocess
this.pathAliases = pathAliases
}
async bundle (generate: 'ssr' | 'dom', sveltePath = 'svelte'): Promise<string> {
@ -74,6 +77,7 @@ class Builder {
bundle: true,
format: 'esm',
metafile: true,
alias: this.pathAliases || [],
plugins: [
// @ts-expect-error
sveltePlugin({