Skip to content

Commit beced4f

Browse files
fix(vite): remove Deno global check
Ultimately, it casues more problems than it solves.
1 parent c22c20e commit beced4f

3 files changed

Lines changed: 0 additions & 65 deletions

File tree

packages/plugin-vite/src/plugins/patches.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import babelReact from "@babel/preset-react";
66
import { inlineEnvVarsPlugin } from "./patches/inline_env_vars.ts";
77
import { removePolyfills } from "./patches/remove_polyfills.ts";
88
import { JS_REG, JSX_REG } from "../utils.ts";
9-
import { denoGlobal } from "./patches/deno_global.ts";
109
import { codeEvalPlugin } from "./patches/code_eval.ts";
1110

1211
export function patches(): Plugin {
@@ -44,10 +43,6 @@ export function patches(): Plugin {
4443
inlineEnvVarsPlugin(env, Deno.env.toObject()),
4544
];
4645

47-
if (!options?.ssr) {
48-
plugins.push(denoGlobal);
49-
}
50-
5146
const res = babel.transformSync(code, {
5247
filename: id,
5348
babelrc: false,

packages/plugin-vite/src/plugins/patches/deno_global.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

packages/plugin-vite/tests/build_test.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -408,30 +408,6 @@ Deno.test({
408408
sanitizeResources: false,
409409
});
410410

411-
Deno.test({
412-
name: "vite build - throw when using Deno.* global inside an island",
413-
fn: async () => {
414-
const fixture = path.join(FIXTURE_DIR, "deno_global_island");
415-
416-
await expect(buildVite(fixture)).rejects.toThrow(
417-
"The Deno.* global cannot be used in the browser",
418-
);
419-
},
420-
sanitizeOps: false,
421-
sanitizeResources: false,
422-
});
423-
424-
Deno.test({
425-
name: "vite build - don't throw when using Deno.* global in ssr",
426-
fn: async () => {
427-
const fixture = path.join(FIXTURE_DIR, "deno_global_ssr");
428-
429-
await buildVite(fixture);
430-
},
431-
sanitizeOps: false,
432-
sanitizeResources: false,
433-
});
434-
435411
Deno.test({
436412
name: "vite build - static index.html",
437413
fn: async () => {

0 commit comments

Comments
 (0)