Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keepNames to esbuild options #150

Merged
merged 5 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default {

### esbuildOptions

An object containing additional [esbuild options](https://esbuild.github.io/api/#build-api). Currently only supports [external](https://esbuild.github.io/api/#external). If you require additional options to be exposed, plese [open an issue](https://github.com/geoffrich/svelte-adapter-azure-swa/issues).
An object containing additional [esbuild options](https://esbuild.github.io/api/#build-api). Currently only supports [external](https://esbuild.github.io/api/#external) and [keep-names](https://esbuild.github.io/api/#keep-names). If you require additional options to be exposed, plese [open an issue](https://github.com/geoffrich/svelte-adapter-azure-swa/issues).
geoffrich marked this conversation as resolved.
Show resolved Hide resolved

```js
import azure from 'svelte-adapter-azure-swa';
Expand All @@ -206,7 +206,8 @@ export default {
...
adapter: azure({
esbuildOptions: {
external: ['fsevents']
external: ['fsevents'],
keepNames: [true, false]
bananabrann marked this conversation as resolved.
Show resolved Hide resolved
bananabrann marked this conversation as resolved.
Show resolved Hide resolved
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export * from './types/swa';
export type Options = {
debug?: boolean;
customStaticWebAppConfig?: CustomStaticWebAppConfig;
esbuildOptions?: Pick<esbuild.BuildOptions, 'external'>;
esbuildOptions?: Pick<esbuild.BuildOptions, 'external' | 'keepNames'>;
apiDir?: string;
staticDir?: string;
allowReservedSwaRoutes?: boolean;
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ If you want to suppress this error, set allowReservedSwaRoutes to true in your a
platform: 'node',
target: 'node16',
sourcemap: 'linked',
external: esbuildOptions.external
external: esbuildOptions.external,
keepNames: esbuildOptions.keepNames
};

await esbuild.build(default_options);
Expand Down