Skip to content

Commit

Permalink
rename param
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Aug 7, 2024
1 parent 617adc9 commit 024684c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/astro/src/content/data-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ function dataStoreSingleton() {
// TODO: find a better place to put this image
export function contentModuleToId(fileName: string, specifier: string) {
const params = new URLSearchParams(specifier);
params.set('importer', fileName);
params.set('fileName', fileName);
params.set(DEFERRED_MODULE, 'true');
return `${specifier}?${params.toString()}`;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/astro/src/content/vite-plugin-content-virtual-mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ export function astroContentVirtualModPlugin({
if (isDeferredModule(id)) {
const [, query] = id.split('?');
const params = new URLSearchParams(query);
const importerParam = params.get('importer');
const fileName = params.get('fileName');
let importerPath = undefined;
if (importerParam && URL.canParse(importerParam, settings.config.root.toString())) {
importerPath = fileURLToPath(new URL(importerParam, settings.config.root));
if (fileName && URL.canParse(fileName, settings.config.root.toString())) {
importerPath = fileURLToPath(new URL(fileName, settings.config.root));
}
if (importerPath) {
return await this.resolve(importerPath);
Expand Down

0 comments on commit 024684c

Please sign in to comment.