Minor Changes
-
#3726
7d20bdbd
Thanks @petebacondarwin! - feat: support partial bundling with configurable external modulesSetting
find_additional_modules
totrue
in your configuration file will now instruct Wrangler to look for files in
yourbase_dir
that match your configuredrules
, and deploy them as unbundled, external modules with your Worker.
base_dir
defaults to the directory containing yourmain
entrypoint.Wrangler can operate in two modes: the default bundling mode and
--no-bundle
mode. In bundling mode, dynamic imports
(e.g.await import("./large-dep.mjs")
) would be bundled into your entrypoint, making lazy loading less effective.
Additionally, variable dynamic imports (e.g.await import(`./lang/${language}.mjs`)
) would always fail at runtime,
as Wrangler would have no way of knowing which modules to upload. The--no-bundle
mode sought to address these issues
by disabling Wrangler's bundling entirely, and just deploying code as is. Unfortunately, this also disabled Wrangler's
code transformations (e.g. TypeScript compilation,--assets
,--test-scheduled
, etc).With this change, we now additionally support partial bundling. Files are bundled into a single Worker entry-point file
unlessfind_additional_modules
istrue
, and the file matches one of the configuredrules
. See
https://developers.cloudflare.com/workers/wrangler/bundling/ for more details and examples. -
#4093
c71d8a0f
Thanks @mrbbot! - chore: bumpminiflare
to3.20231002.0
Patch Changes
-
#3726
7d20bdbd
Thanks @petebacondarwin! - fix: ensure that additional modules appear in the out-dirWhen using
find_additional_modules
(orno_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. -
#4067
31270711
Thanks @mrbbot! - fix: generate valid source maps withwrangler pages dev
on macOSOn macOS,
wrangler pages dev
previously generated source maps with an
incorrect number of../
s in relative paths. This change ensures paths are
always correct, improving support for breakpoint debugging. -
#4084
9a7559b6
Thanks @RamIdeas! - fix: respect the options.local value in unstable_dev (it was being ignored) -
#4107
807ab931
Thanks @mrbbot! - chore: bumpminiflare
to3.20231002.1
-
#3726
7d20bdbd
Thanks @petebacondarwin! - fix: allow__STATIC_CONTENT_MANIFEST
module to be imported anywhere__STATIC_CONTENT_MANIFEST
can now be imported in subdirectories when
--no-bundle
orfind_additional_modules
are enabled. -
#3926
f585f695
Thanks @penalosa! - Log more detail about tokens after authentication errors -
#3695
1d0b7ad5
Thanks @JacksonKearl! - Fixedpages dev
crashing and leaving port open when building a worker script fails -
#4066
c8b4a07f
Thanks @RamIdeas! - fix: we no longer infer pathnames from route patterns as the hostDuring local development, inside your worker, the host of
request.url
is inferred from theroutes
in your config.Previously, route patterns like "*/some/path/name" would infer the host as "some". We now handle this case and determine we cannot infer a host from such patterns.