Skip to content

Commit

Permalink
feat: add keepNames to esbuildOptions (#150)
Browse files Browse the repository at this point in the history
* Add keepNames to esbuild options

* Add keep-names information to esbuildOptions section

* Change readme section from list of options to example

Co-authored-by: Tobias Laundal <tobias@laundal.no>

* docs: fix typos

---------

Co-authored-by: Tobias Laundal <tobias@laundal.no>
Co-authored-by: Geoff Rich <4992896+geoffrich@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 3, 2023
1 parent aab7908 commit dbe44ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
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, please [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 [keepNames](https://esbuild.github.io/api/#keep-names). If you require additional options to be exposed, please [open an issue](https://github.com/geoffrich/svelte-adapter-azure-swa/issues).

```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
}
})
}
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

0 comments on commit dbe44ba

Please sign in to comment.