Skip to content

Commit c7d6a22

Browse files
Document the bundler-args argument (#1164)
1 parent b450892 commit c7d6a22

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,14 @@ $ node -e "import('./index.js').then(m => console.log(m.main))"
952952
[Function]
953953
```
954954

955+
Spago does not wrap the entirety of the bundler's API (esbuild for JS builds), so it's possible to pass arguments through to it. E.g. to exclude an NPM package from the bundle you can pass the `--external` flag to esbuild:
956+
- either through the command line, with the `--bundler-args` flag, i.e. `--bundler-args "--external:better-sqlite3"`.
957+
- or by adding it to the configuration file:
958+
```yaml
959+
package:
960+
bundle:
961+
extra_args:
962+
- "--external:better-sqlite3"
955963
### Enable source maps
956964
957965
When bundling, you can include `--source-maps` to generate a final source map for your bundle.

0 commit comments

Comments
 (0)