fix(vite): babel transform being applied for non-js files (#3238)
This commit is contained in:
@@ -340,3 +340,24 @@ Deno.test({
|
||||
sanitizeOps: false,
|
||||
sanitizeResources: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "vite build - import json from jsr dependency",
|
||||
fn: async () => {
|
||||
await using res = await buildVite(DEMO_DIR);
|
||||
|
||||
await withChildProcessServer(
|
||||
{
|
||||
cwd: res.tmp,
|
||||
args: ["serve", "-A", "--port", "0", "_fresh/server.js"],
|
||||
},
|
||||
async (address) => {
|
||||
const res = await fetch(`${address}/tests/dep_json`);
|
||||
const json = await res.json();
|
||||
expect(json.name).toEqual("@marvinh-test/import-json");
|
||||
},
|
||||
);
|
||||
},
|
||||
sanitizeOps: false,
|
||||
sanitizeResources: false,
|
||||
});
|
||||
|
||||
@@ -238,3 +238,16 @@ Deno.test({
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "vite dev - json from jsr dependency",
|
||||
fn: async () => {
|
||||
await withDevServer(DEMO_DIR, async (address) => {
|
||||
const res = await fetch(`${address}/tests/dep_json`);
|
||||
const json = await res.json();
|
||||
expect(json.name).toEqual("@marvinh-test/import-json");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user