Commit 7d20bdb
Add
* typo
* move stuff
* remove unnecessary typing
* remove unnecessary `active` property from middleware loader config
* more refactorings
* rename traverseModuleGraph as this is not what it does
* refactor to simplify findAdditionalModules()
* Rename the functions build helpers to make it more clear what their role is.
* invert module collector config - no longer need to return it as it is passed in
* implement module finding in normal bundling if the find_additional_modules flag is on
* allow `__STATIC_CONTENT_MANIFEST` to be imported from any module
* test: improve no-bundle-import tests
The no-bundle-import tests would actually pass if Wrangler actually bundled the code,
since it would identify and inline all the dynamic
imports that were being tested.
This change adds a test that would not pass if we are not capturing the additional modules.
It also moves the declaration of no-bundle to the wrangler.toml to ensure that normal use of `wrangler dev` will get this behavior.
* refactor: convert additional file finding to a generator function
This has a few of benefits:
- we don't risk creating too many file reads in a single go (using up all the available file handles); previously file reads were all done in parallel
- we don't read the files over and over for each rule
- the code is a bit easier to follow as we don't have to create `Promise.all()` objects
* fix: ensure that additional modules appear in the out-dir
When using `find_additional_modules` (or `no_bundle`) we find files that
will be uploaded to be deployed alongside the Worker.
Previously, if an `outDir` was specified, only the Worker code was output
to this directory. Now all additional modules are also output there too.
* pnpm fixups
* test: ignore failure to remove tmp dir on Windows
* test: do not show output in d1 time-travel tests
* refactor: consolidate writing additional modules
* test: add CommonJS lazy import to additional-modules fixture
* test: rename spec to test
* Add debug logging when writing additional modules
* Test additional module failure case and fix message typo
* Display build warnings before updating the bundle
---------
Co-authored-by: bcoll <[email protected]>find_additional_modules option to support partial bundling with externals (#3726)1 parent 5fc7a88 commit 7d20bdb
File tree
58 files changed
+1834
-1080
lines changed- .changeset
- fixtures
- additional-modules
- src
- lang
- test
- no-bundle-import
- src
- packages
- workers-playground/src/QuickEditor
- wrangler
- src
- __tests__
- d1
- api/pages
- config
- deployment-bundle
- deploy
- dev
- pages
- functions
- templates
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
58 files changed
+1834
-1080
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments