Skip to content

Commit

Permalink
fix: ensure that alias config gets passed through to the bundler wh…
Browse files Browse the repository at this point in the history
…en using new `--x-dev-env` (#6903)

Fixes #6898
  • Loading branch information
petebacondarwin authored Oct 7, 2024
1 parent dc92af2 commit 54924a4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/grumpy-apples-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": patch
---

fix: ensure that `alias` config gets passed through to the bundler when using new `--x-dev-env`

Fixes #6898
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,20 @@ describe("ConfigController", () => {
dev: {
origin: { hostname: "myexample.com" },
},
build: {
alias: { foo: "bar" },
},
});
// expect `dev` field to be overwritten and all other config to remain intact
// expect `dev` and `build.alias` fields to be overwritten and all other config to remain intact
await expect(event3).resolves.toMatchObject({
type: "configUpdate",
config: {
entrypoint: path.join(process.cwd(), "src/index.ts"),
directory: process.cwd(),
build: {
alias: {
foo: "bar",
},
additionalModules: [],
define: {},
format: "modules",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ async function resolveConfig(
triggers: await resolveTriggers(config, input),
env: input.env,
build: {
alias: input.build?.alias ?? config.alias,
additionalModules: input.build?.additionalModules ?? [],
processEntrypoint: Boolean(input.build?.processEntrypoint),
bundle: input.build?.bundle ?? !config.no_bundle,
Expand Down

0 comments on commit 54924a4

Please sign in to comment.