Skip to content

Commit

Permalink
ensure inline content is recognized into @fs files too
Browse files Browse the repository at this point in the history
  • Loading branch information
dmail committed Dec 30, 2024
1 parent 8929423 commit 14302af
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
15 changes: 11 additions & 4 deletions dist/jsenv_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -17634,10 +17634,17 @@ const jsenvPluginInlineContentFetcher = () => {
}
let isDirectRequestToFile;
if (urlInfo.context.request) {
const requestedUrl = new URL(
urlInfo.context.request.resource.slice(1),
urlInfo.context.rootDirectoryUrl,
).href;
let requestResource = urlInfo.context.request.resource;
let requestedUrl;
if (requestResource.startsWith("/@fs/")) {
const fsRootRelativeUrl = requestResource.slice("/@fs/".length);
requestedUrl = `file:///${fsRootRelativeUrl}`;
} else {
requestedUrl = new URL(
requestResource.slice(1),
urlInfo.context.rootDirectoryUrl,
).href;
}
isDirectRequestToFile = requestedUrl === urlInfo.url;
}
/*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jsenv/core",
"version": "39.9.0",
"version": "39.9.1",
"description": "Tool to develop, test and build js projects",
"license": "MIT",
"author": {
Expand Down
15 changes: 11 additions & 4 deletions src/plugins/reference_analysis/jsenv_plugin_reference_analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,17 @@ const jsenvPluginInlineContentFetcher = () => {
}
let isDirectRequestToFile;
if (urlInfo.context.request) {
const requestedUrl = new URL(
urlInfo.context.request.resource.slice(1),
urlInfo.context.rootDirectoryUrl,
).href;
let requestResource = urlInfo.context.request.resource;
let requestedUrl;
if (requestResource.startsWith("/@fs/")) {
const fsRootRelativeUrl = requestResource.slice("/@fs/".length);
requestedUrl = `file:///${fsRootRelativeUrl}`;
} else {
requestedUrl = new URL(
requestResource.slice(1),
urlInfo.context.rootDirectoryUrl,
).href;
}
isDirectRequestToFile = requestedUrl === urlInfo.url;
}
/*
Expand Down

0 comments on commit 14302af

Please sign in to comment.