Skip to content

Commit

Permalink
Document the bundler-args argument (#1164)
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanCacqueray authored Jan 14, 2024
1 parent b450892 commit c7d6a22
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,14 @@ $ node -e "import('./index.js').then(m => console.log(m.main))"
[Function]
```

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:
- either through the command line, with the `--bundler-args` flag, i.e. `--bundler-args "--external:better-sqlite3"`.
- or by adding it to the configuration file:
```yaml
package:
bundle:
extra_args:
- "--external:better-sqlite3"
### Enable source maps
When bundling, you can include `--source-maps` to generate a final source map for your bundle.
Expand Down

0 comments on commit c7d6a22

Please sign in to comment.