Skip to content

Commit

Permalink
feat: add loader to esbuildOptions (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrich committed Aug 17, 2023
1 parent 1b35c22 commit f1f4ec6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 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) 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).
An object containing additional [esbuild options](https://esbuild.github.io/api/#build-api). Currently only supports [external](https://esbuild.github.io/api/#external), [keepNames](https://esbuild.github.io/api/#keep-names), and [loader](https://esbuild.github.io/api/#loader). 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 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' | 'keepNames'>;
esbuildOptions?: Pick<esbuild.BuildOptions, 'external' | 'keepNames' | 'loader'>;
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 @@ -132,7 +132,8 @@ If you want to suppress this error, set allowReservedSwaRoutes to true in your a
target: 'node16',
sourcemap: 'linked',
external: esbuildOptions.external,
keepNames: esbuildOptions.keepNames
keepNames: esbuildOptions.keepNames,
loader: esbuildOptions.loader
};

await esbuild.build(default_options);
Expand Down

0 comments on commit f1f4ec6

Please sign in to comment.