Skip to content

Commit 257e7f9

Browse files
dario-piotrowiczjamesopstadpenalosa
authored
improve the vite-plugin debugging experience (#8441)
* add `inspectorPort` option to plugin config * add `/__debug` path to both `vite dev` and `vite preview` * add debugging documentation to vite-plugin readme * Update packages/vite-plugin-cloudflare/src/debugging.ts Co-authored-by: James Opstad <[email protected]> * Update packages/vite-plugin-cloudflare/README.md Co-authored-by: James Opstad <[email protected]> * Update packages/vite-plugin-cloudflare/src/index.ts Co-authored-by: James Opstad <[email protected]> * separate __debug path logic into its own plugin * add `false` as a possible option for `inspectorPort` * add inspectorPort to readme API section * add default value of inspectorPort in readme * Update packages/vite-plugin-cloudflare/README.md Co-authored-by: James Opstad <[email protected]> * update README vscde configurations with NAME_OF_WORKER * remove unused import * use server.resolvedUrls * use picocolors to color the debug url * revert inspectorPort unintentionally committed to 9229 * add missing inspectorPort in module-resolution playground * add missing `inspectorPort: false` to static playground app * add missing `inspectorPort: false` to static-with-api playground app * Apply suggestions from code review for README.md Co-authored-by: Somhairle MacLeòid <[email protected]> * Update packages/vite-plugin-cloudflare/src/debugging.ts Co-authored-by: Somhairle MacLeòid <[email protected]> * just use json stringify for the workerDevtoolsUrls handling * add domain to `devtoolsFrontendUrl` * use `URLSearchParams` to create devtools frontend url * update `minor` to `patch` * Update .changeset/polite-walls-bathe.md Co-authored-by: James Opstad <[email protected]> * move debug plugin and add `enforce: pre` to it --------- Co-authored-by: James Opstad <[email protected]> Co-authored-by: Somhairle MacLeòid <[email protected]>
1 parent 100c77b commit 257e7f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+328
-62
lines changed

.changeset/polite-walls-bathe.md

Lines changed: 7 additions & 0 deletions

.changeset/red-cow-eats.md

Lines changed: 7 additions & 0 deletions

packages/vite-plugin-cloudflare/README.md

Lines changed: 61 additions & 1 deletion

packages/vite-plugin-cloudflare/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"@cloudflare/unenv-preset": "workspace:*",
4646
"@hattip/adapter-node": "^0.0.49",
4747
"miniflare": "workspace:*",
48+
"picocolors": "^1.1.1",
4849
"tinyglobby": "^0.2.12",
4950
"unenv": "2.0.0-rc.15",
5051
"wrangler": "workspace:*",

packages/vite-plugin-cloudflare/playground/additional-modules/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { cloudflare } from "@cloudflare/vite-plugin";
22
import { defineConfig } from "vite";
33

44
export default defineConfig({
5-
plugins: [cloudflare({ persistState: false })],
5+
plugins: [cloudflare({ inspectorPort: false, persistState: false })],
66
});

packages/vite-plugin-cloudflare/playground/cloudflare-env/vite.config.custom-mode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import { defineConfig } from "vite";
33

44
export default defineConfig({
55
mode: "custom-mode",
6-
plugins: [cloudflare({ persistState: false })],
6+
plugins: [cloudflare({ inspectorPort: false, persistState: false })],
77
});

packages/vite-plugin-cloudflare/playground/cloudflare-env/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { cloudflare } from "@cloudflare/vite-plugin";
22
import { defineConfig } from "vite";
33

44
export default defineConfig({
5-
plugins: [cloudflare({ persistState: false })],
5+
plugins: [cloudflare({ inspectorPort: false, persistState: false })],
66
});

packages/vite-plugin-cloudflare/playground/custom-build-app/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export default defineConfig({
1313
}
1414
},
1515
},
16-
plugins: [cloudflare({ persistState: false })],
16+
plugins: [cloudflare({ inspectorPort: false, persistState: false })],
1717
});

packages/vite-plugin-cloudflare/playground/dev-vars/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { cloudflare } from "@cloudflare/vite-plugin";
22
import { defineConfig } from "vite";
33

44
export default defineConfig({
5-
plugins: [cloudflare({ persistState: false })],
5+
plugins: [cloudflare({ inspectorPort: false, persistState: false })],
66
});

packages/vite-plugin-cloudflare/playground/dev-vars/vite.config.with-specified-env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import { defineConfig } from "vite";
33

44
export default defineConfig({
55
mode: "with-specified-env",
6-
plugins: [cloudflare({ persistState: false })],
6+
plugins: [cloudflare({ inspectorPort: false, persistState: false })],
77
});

0 commit comments

Comments
 (0)