fix(vite): asset handling (#3225)
This PR reworks asset handling in our vite plugin. Importing assets in js is now supported.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { Middleware } from "./mod.ts";
|
||||
import { ASSET_CACHE_BUST_KEY } from "../runtime/shared_internal.tsx";
|
||||
import { ASSET_CACHE_BUST_KEY } from "../constants.ts";
|
||||
import { BUILD_ID } from "@fresh/build-id";
|
||||
import { tracer } from "../otel.ts";
|
||||
import { getBuildCache } from "../context.ts";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { staticFiles } from "./static_files.ts";
|
||||
import { serveMiddleware } from "../test_utils.ts";
|
||||
import type { BuildCache, StaticFile } from "../build_cache.ts";
|
||||
import { expect } from "@std/expect";
|
||||
import { ASSET_CACHE_BUST_KEY } from "../runtime/shared_internal.tsx";
|
||||
import { ASSET_CACHE_BUST_KEY } from "../constants.ts";
|
||||
import { BUILD_ID } from "@fresh/build-id";
|
||||
import type { Command } from "../commands.ts";
|
||||
import type { ServerIslandRegistry } from "../context.ts";
|
||||
@@ -32,6 +32,10 @@ class MockBuildCache implements BuildCache {
|
||||
}
|
||||
}
|
||||
|
||||
getEntryAssets(): string[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
// deno-lint-ignore no-explicit-any
|
||||
getFsRoutes(): Command<any>[] {
|
||||
return [];
|
||||
|
||||
Reference in New Issue
Block a user