Skip to content

Commit 4443690

Browse files
committed
chore: cleanup hasContentFlag
1 parent 0ee02c9 commit 4443690

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

packages/astro/src/content/vite-plugin-content-assets.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ import {
2020
} from './consts.js';
2121
import { hasContentFlag } from './utils.js';
2222

23-
// TODO: replace with `hasContentFlag`
24-
function isPropagatedAsset(viteId: string): boolean {
25-
const url = new URL(viteId, 'file://');
26-
return url.searchParams.has(PROPAGATED_ASSET_FLAG);
27-
}
28-
2923
export function astroContentAssetPropagationPlugin({
3024
mode,
3125
settings,
@@ -62,7 +56,7 @@ export function astroContentAssetPropagationPlugin({
6256
}
6357
},
6458
load(id) {
65-
if (isPropagatedAsset(id)) {
59+
if (hasContentFlag(id, CONTENT_RENDER_FLAG)) {
6660
const basePath = id.split('?')[0];
6761
const code = `
6862
function getMod() {
@@ -83,7 +77,7 @@ export function astroContentAssetPropagationPlugin({
8377
},
8478
async transform(code, id, options) {
8579
if (!options?.ssr) return;
86-
if (devModuleLoader && isPropagatedAsset(id)) {
80+
if (devModuleLoader && hasContentFlag(id, CONTENT_RENDER_FLAG)) {
8781
const basePath = id.split('?')[0];
8882
if (!devModuleLoader.getModuleById(basePath)?.ssrModule) {
8983
await devModuleLoader.import(basePath);

0 commit comments

Comments
 (0)