Skip to content

Commit

Permalink
feat(bundle-source): Entrain devDependencies with development condition
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Jul 25, 2024
1 parent 37174ae commit 308307e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/bundle-source/NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
- Adds a no-cache, bundle-to-stdout mode.
- Adds a `-C,--condition` command flag to specify export/import conditions like
`"development"` or `"browser"`.
- The `-C development` condition now provides access to `devDependencies` in
the `package.json` of the entry package of a bundle.

# v3.2.1 (2024-03-20)

Expand Down
13 changes: 13 additions & 0 deletions packages/bundle-source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ by the `moduleFormat` below.
The resulting bundle is suitable for use with `@endo/import-bundle`.
The default format is of a bundle is `"endoZipBase64"`.
## Conditions
Node.js introduced [conditions](https://nodejs.org/api/packages.html#conditional-exports).
The `--condition` and `-C` flags accordingly influence `bundle-source` module
resolution decisions.
The `browser` condition additionally implies the selection of the `browser`
entry instead of `main` in `package.json`, if not overridden by explicit
`exports`.
The `development` condition additionally implies that the bundle may import
`devDependencies` from the package containing the entry module.
## Source maps
With the `moduleFormat` of `endoZipBase64`, the bundler can generate source
Expand Down
1 change: 1 addition & 0 deletions packages/bundle-source/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ bundle-source [-Tft] <entry.js>
bundle-source [-Tft] --cache-js|--cache-json <cache/> (<entry.js> <bundle-name>)*
-f,--format endoZipBase64*|nestedEvaluate|getExport
-C,--condition <condition> (browser, node, development, &c)
-C development (to access devDependencies)
-T,--no-transforms`;

const options = /** @type {const} */ ({
Expand Down

0 comments on commit 308307e

Please sign in to comment.