Skip to content

Commit 87c455b

Browse files
authored
fix(templates): add node:process import for deno in vite config templates (#960)
1 parent 0b66048 commit 87c455b

12 files changed

Lines changed: 23 additions & 18 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"create-tauri-app": patch
3+
"create-tauri-app-js": patch
4+
---
5+
6+
added `import process from "node:process"` to Vite-based templates

templates/template-preact-ts/vite.config.ts.lte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "vite";
22
import preact from "@preact/preset-vite";{% if v2 %}
3-
4-
// @ts-expect-error process is a nodejs global
3+
// @ts-expect-error type error without @types/node package
4+
import process from "node:process";
55
const host = process.env.TAURI_DEV_HOST;{% endif %}
66

77
// https://vite.dev/config/

templates/template-preact/vite.config.js.lte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineConfig } from "vite";
22
import preact from "@preact/preset-vite";{% if v2 %}
3-
3+
import process from "node:process";
44
const host = process.env.TAURI_DEV_HOST;{% endif %}
55

66
// https://vite.dev/config/

templates/template-react-ts/vite.config.ts.lte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "vite";
22
import react from "@vitejs/plugin-react";{% if v2 %}
3-
4-
// @ts-expect-error process is a nodejs global
3+
// @ts-expect-error type error without @types/node package
4+
import process from "node:process";
55
const host = process.env.TAURI_DEV_HOST;{% endif %}
66

77
// https://vite.dev/config/

templates/template-react/vite.config.js.lte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineConfig } from "vite";
22
import react from "@vitejs/plugin-react";{% if v2 %}
3-
3+
import process from "node:process";
44
const host = process.env.TAURI_DEV_HOST;{% endif %}
55

66
// https://vite.dev/config/

templates/template-solid-ts/vite.config.ts.lte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "vite";
22
import solid from "vite-plugin-solid";{% if v2 %}
3-
4-
// @ts-expect-error process is a nodejs global
3+
// @ts-expect-error type error without @types/node package
4+
import process from "node:process";
55
const host = process.env.TAURI_DEV_HOST;{% endif %}
66

77
// https://vite.dev/config/

templates/template-solid/vite.config.js.lte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineConfig } from "vite";
22
import solid from "vite-plugin-solid";{% if v2 %}
3-
3+
import process from "node:process";
44
const host = process.env.TAURI_DEV_HOST;{% endif %}
55

66
// https://vite.dev/config/

templates/template-svelte-ts/vite.config.js.lte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "vite";
22
import { sveltekit } from "@sveltejs/kit/vite";{% if v2 %}
3-
4-
// @ts-expect-error process is a nodejs global
3+
// @ts-expect-error type error without @types/node package
4+
import process from "node:process";
55
const host = process.env.TAURI_DEV_HOST;{% endif %}
66

77
// https://vite.dev/config/

templates/template-svelte/vite.config.js.lte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { defineConfig } from "vite";
22
import { sveltekit } from "@sveltejs/kit/vite";{% if v2 %}
3-
4-
// @ts-expect-error process is a nodejs global
3+
import process from "node:process";
54
const host = process.env.TAURI_DEV_HOST;{% endif %}
65

76
// https://vite.dev/config/

templates/template-vanilla-ts/vite.config.ts.lte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineConfig } from "vite";{% if v2 %}
2-
3-
// @ts-expect-error process is a nodejs global
2+
// @ts-expect-error type error without @types/node package
3+
import process from "node:process";
44
const host = process.env.TAURI_DEV_HOST;{% endif %}
55

66
// https://vite.dev/config/

0 commit comments

Comments
 (0)