Add path aliases
This commit is contained in:
parent 437807fc3b
commit edc7c48f6a
1 changed files with 5 additions and 1 deletions
| @ -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({ | ||||
| |
Loading…
Add table
Add a link
Reference in a new issue