diff --git a/.changeset/kind-ducks-pay.md b/.changeset/kind-ducks-pay.md new file mode 100644 index 000000000000..939888c359c0 --- /dev/null +++ b/.changeset/kind-ducks-pay.md @@ -0,0 +1,5 @@ +--- +"wrangler": minor +--- + +feature: Python support for remote dev diff --git a/packages/wrangler/src/deployment-bundle/source-url.ts b/packages/wrangler/src/deployment-bundle/source-url.ts index 98a146264e5b..0711bf515dad 100644 --- a/packages/wrangler/src/deployment-bundle/source-url.ts +++ b/packages/wrangler/src/deployment-bundle/source-url.ts @@ -17,7 +17,9 @@ export function withSourceURLs( modules: CfModule[] ): { entrypointSource: string; modules: CfModule[] } { let entrypointSource = fs.readFileSync(entrypointPath, "utf8"); - entrypointSource = withSourceURL(entrypointSource, entrypointPath); + if (!entrypointPath.endsWith(".py")) { + entrypointSource = withSourceURL(entrypointSource, entrypointPath); + } modules = modules.map((module) => { if ( diff --git a/packages/wrangler/src/dev/remote.tsx b/packages/wrangler/src/dev/remote.tsx index 524d7749a939..7508cd082b95 100644 --- a/packages/wrangler/src/dev/remote.tsx +++ b/packages/wrangler/src/dev/remote.tsx @@ -606,7 +606,7 @@ async function createRemoteWorkerInit(props: { main: { name: path.basename(props.bundle.path), filePath: props.bundle.path, - type: getBundleType(props.format), + type: getBundleType(props.format, path.basename(props.bundle.path)), content, }, modules,