diff --git a/packages/wrangler/src/api/startDevWorker/BundlerController.ts b/packages/wrangler/src/api/startDevWorker/BundlerController.ts index 736fd772833d..0795daad6c1e 100644 --- a/packages/wrangler/src/api/startDevWorker/BundlerController.ts +++ b/packages/wrangler/src/api/startDevWorker/BundlerController.ts @@ -61,7 +61,6 @@ export class BundlerController extends Controller { return; } assert(this.#tmpDir); - assert(config._additionalModules, "config._additionalModules"); assert(config.build?.moduleRules, "config.build?.moduleRules"); assert(config.build?.define, "config.build?.define"); if (!config.build?.bundle) { @@ -193,7 +192,6 @@ export class BundlerController extends Controller { return; } assert(this.#tmpDir); - assert(config._additionalModules, "config._additionalModules"); assert(config.build?.moduleRules, "config.build?.moduleRules"); assert(config.build?.define, "config.build?.define"); const entry: Entry = { @@ -208,8 +206,8 @@ export class BundlerController extends Controller { destination: this.#tmpDir.path, jsxFactory: config.build?.jsxFactory, jsxFragment: config.build?.jsxFragment, - processEntrypoint: Boolean(config._processEntrypoint), - additionalModules: config._additionalModules, + processEntrypoint: Boolean(config.build?.processEntrypoint), + additionalModules: config.build?.additionalModules ?? [], rules: config.build.moduleRules, assets: config.legacy?.assets, serveAssetsFromWorker: Boolean( diff --git a/packages/wrangler/src/api/startDevWorker/types.ts b/packages/wrangler/src/api/startDevWorker/types.ts index 114beb9f67fc..2400b9fb8a5f 100644 --- a/packages/wrangler/src/api/startDevWorker/types.ts +++ b/packages/wrangler/src/api/startDevWorker/types.ts @@ -67,8 +67,6 @@ export interface InputStartDevWorkerOptions { /** The triggers which will cause the worker's exported default handlers to be called. */ triggers?: Trigger[]; - // -- PASSTHROUGH -- FROM OLD CONFIG TO NEW CONFIG (TEMP) - /** * Whether Wrangler should send usage metrics to Cloudflare for this project. * @@ -78,16 +76,16 @@ export interface InputStartDevWorkerOptions { sendMetrics?: boolean; usageModel?: "bundled" | "unbound"; _bindings?: CfWorkerInit["bindings"]; // Type level constraint for bindings not sharing names - _processEntrypoint?: boolean; - _additionalModules?: CfModule[]; - // --/ PASSTHROUGH -- /** Options applying to the worker's build step. Applies to deploy and dev. */ build?: { /** Whether the worker and its dependencies are bundled. Defaults to true. */ bundle?: boolean; + additionalModules?: CfModule[]; + findAdditionalModules?: boolean; + processEntrypoint?: boolean; /** Specifies types of modules matched by globs. */ moduleRules?: Rule[]; /** Replace global identifiers with constant expressions, e.g. { debug: 'true', version: '"1.0.0"' }. Only takes effect if bundle: true. */ diff --git a/packages/wrangler/src/dev/dev.tsx b/packages/wrangler/src/dev/dev.tsx index 7f286bf65914..8d760280a41f 100644 --- a/packages/wrangler/src/dev/dev.tsx +++ b/packages/wrangler/src/dev/dev.tsx @@ -382,14 +382,13 @@ function DevSession(props: DevSessionProps) { script: { path: props.entry.file }, directory: props.entry.directory, _bindings: props.bindings, - _processEntrypoint: props.processEntrypoint, - _additionalModules: props.additionalModules, triggers: [...routes, ...queueConsumers, ...crons], env: props.env, sendMetrics: props.sendMetrics, - usageModel: props.usageModel, build: { + additionalModules: props.additionalModules, + processEntrypoint: props.processEntrypoint, bundle: !props.noBundle, findAdditionalModules: props.findAdditionalModules, minify: props.minify, @@ -467,7 +466,6 @@ function DevSession(props: DevSessionProps) { props.env, props.legacyEnv, props.sendMetrics, - props.usageModel, props.noBundle, props.findAdditionalModules, props.minify,