@jsenv/core 27.0.0-alpha.65 → 27.0.0-alpha.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/AsyncGenerator/AsyncGenerator.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/AwaitValue/AwaitValue.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/applyDecoratorDescriptor/applyDecoratorDescriptor.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/arrayLikeToArray/arrayLikeToArray.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/arrayWithHoles/arrayWithHoles.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/arrayWithoutHoles/arrayWithoutHoles.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/assertThisInitialized/assertThisInitialized.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/asyncGeneratorDelegate/asyncGeneratorDelegate.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/asyncIterator/asyncIterator.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/asyncToGenerator/asyncToGenerator.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/awaitAsyncGenerator/awaitAsyncGenerator.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classCallCheck/classCallCheck.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classNameTDZError/classNameTDZError.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classPrivateFieldGet/classPrivateFieldGet.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classPrivateFieldSet/classPrivateFieldSet.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classPrivateMethodGet/classPrivateMethodGet.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classPrivateMethodSet/classPrivateMethodSet.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/construct/construct.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/createClass/createClass.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/createForOfIteratorHelper/createForOfIteratorHelper.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/createRawReactElement/createRawReactElement.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/createSuper/createSuper.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/decorate/decorate.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/defaults/defaults.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/defineEnumerableProperties/defineEnumerableProperties.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/defineProperty/defineProperty.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/extends/extends.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/get/get.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/getPrototypeOf/getPrototypeOf.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/inherits/inherits.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/inheritsLoose/inheritsLoose.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/initializerDefineProperty/initializerDefineProperty.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/initializerWarningHelper/initializerWarningHelper.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/instanceof/instanceof.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/interopRequireDefault/interopRequireDefault.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/interopRequireWildcard/interopRequireWildcard.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/isNativeFunction/isNativeFunction.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/isNativeReflectConstruct/isNativeReflectConstruct.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/iterableToArray/iterableToArray.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/iterableToArrayLimit/iterableToArrayLimit.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/jsx/jsx.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/maybeArrayLike/maybeArrayLike.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/newArrowCheck/newArrowCheck.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/nonIterableRest/nonIterableRest.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/nonIterableSpread/nonIterableSpread.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/objectDestructuringEmpty/objectDestructuringEmpty.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/objectSpread/objectSpread.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/objectSpread2/objectSpread2.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/objectWithoutProperties/objectWithoutProperties.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/possibleConstructorReturn/possibleConstructorReturn.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/readOnlyError/readOnlyError.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/readme.md +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/set/set.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/setPrototypeOf/setPrototypeOf.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/skipFirstGeneratorNext/skipFirstGeneratorNext.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/slicedToArray/slicedToArray.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/slicedToArrayLoose/slicedToArrayLoose.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/superPropBase/superPropBase.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/tdz/tdz.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/temporalRef/temporalRef.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/temporalUndefined/temporalUndefined.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/toArray/toArray.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/toConsumableArray/toConsumableArray.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/toPrimitive/toPrimitive.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/toPropertyKey/toPropertyKey.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/typeof/typeof.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/unsupportedIterableToArray/unsupportedIterableToArray.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/wrapAsyncGenerator/wrapAsyncGenerator.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/wrapNativeSuper/wrapNativeSuper.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/wrapRegExp/wrapRegExp.js +0 -0
- package/dist/{node_modules/@jsenv/babel-plugins/src/babel_helpers → babel_helpers}/writeOnlyError/writeOnlyError.js +0 -0
- package/dist/html/explorer.html +1 -1
- package/dist/main.js +182 -92
- package/dist/s.js +626 -0
- package/dist/s.js.map +204 -0
- package/package.json +8 -7
- package/src/build/build.js +27 -11
- package/src/build/build_urls_generator.js +1 -1
- package/src/build/resync_ressource_hints.js +1 -1
- package/src/build/start_build_server.js +1 -1
- package/src/dev/plugins/explorer/client/explorer.html +1 -1
- package/src/dev/plugins/explorer/jsenv_plugin_explorer.js +6 -10
- package/src/dev/start_dev_server.js +1 -1
- package/src/execute/run.js +2 -1
- package/src/execute/runtimes/browsers/from_playwright.js +1 -1
- package/src/execute/runtimes/node/node_process.js +1 -1
- package/src/omega/errors.js +2 -2
- package/src/omega/file_url_converter.js +1 -1
- package/src/omega/kitchen.js +49 -7
- package/src/omega/server/file_service.js +2 -2
- package/src/omega/url_graph/url_info_transformations.js +12 -6
- package/src/omega/url_graph.js +3 -2
- package/src/plugins/autoreload/dev_sse/jsenv_plugin_dev_sse_server.js +1 -1
- package/src/plugins/bundling/js_module/bundle_js_module.js +4 -13
- package/src/plugins/file_urls/jsenv_plugin_file_urls.js +44 -30
- package/src/plugins/html_supervisor/jsenv_plugin_html_supervisor.js +1 -1
- package/src/plugins/importmap/jsenv_plugin_importmap.js +1 -1
- package/src/plugins/inline/jsenv_plugin_data_urls.js +1 -1
- package/src/plugins/inline/jsenv_plugin_html_inline_content.js +1 -1
- package/src/plugins/inline/jsenv_plugin_inline_query_param.js +1 -1
- package/src/plugins/inline/jsenv_plugin_js_inline_content.js +3 -3
- package/src/plugins/transpilation/as_js_classic/jsenv_plugin_as_js_classic.js +12 -8
- package/src/plugins/transpilation/as_js_classic/jsenv_plugin_as_js_classic_html.js +4 -2
- package/src/plugins/transpilation/as_js_classic/jsenv_plugin_as_js_classic_workers.js +1 -1
- package/src/plugins/transpilation/import_assertions/jsenv_plugin_import_assertions.js +10 -6
- package/src/plugins/url_analysis/css/css_urls.js +1 -1
- package/src/plugins/url_analysis/html/html_urls.js +1 -1
- package/src/plugins/url_analysis/js/js_urls.js +1 -1
- package/src/plugins/url_analysis/jsenv_plugin_url_analysis.js +16 -18
- package/src/test/execute_plan.js +11 -14
- package/src/test/execute_test_plan.js +10 -16
- package/src/test/execution_steps.js +1 -4
package/src/omega/kitchen.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
urlIsInsideOf,
|
|
3
|
-
writeFileSync,
|
|
4
3
|
moveUrl,
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
getCallerPosition,
|
|
5
|
+
stringifyUrlSite,
|
|
6
|
+
normalizeUrl,
|
|
7
|
+
setUrlFilename,
|
|
8
|
+
} from "@jsenv/urls"
|
|
9
|
+
import { writeFileSync, ensureWindowsDriveLetter } from "@jsenv/filesystem"
|
|
7
10
|
import { createDetailedMessage } from "@jsenv/logger"
|
|
8
11
|
|
|
9
|
-
import { getCallerPosition } from "@jsenv/utils/src/caller_position.js"
|
|
10
|
-
import { stringifyUrlSite } from "@jsenv/utils/urls/url_trace.js"
|
|
11
12
|
import { CONTENT_TYPE } from "@jsenv/utils/content_type/content_type.js"
|
|
12
|
-
import { normalizeUrl, setUrlFilename } from "@jsenv/utils/urls/url_utils.js"
|
|
13
13
|
|
|
14
14
|
import { createPluginController } from "../plugins/plugin_controller.js"
|
|
15
15
|
import { urlSpecifierEncoding } from "./url_specifier_encoding.js"
|
|
@@ -277,6 +277,7 @@ export const createKitchen = ({
|
|
|
277
277
|
type,
|
|
278
278
|
subtype,
|
|
279
279
|
contentType = "application/octet-stream",
|
|
280
|
+
originalUrl,
|
|
280
281
|
originalContent,
|
|
281
282
|
content,
|
|
282
283
|
sourcemap,
|
|
@@ -298,7 +299,8 @@ export const createKitchen = ({
|
|
|
298
299
|
subtype: urlInfo.subtype,
|
|
299
300
|
})
|
|
300
301
|
urlInfo.contentType = contentType
|
|
301
|
-
// during build urls info are reused and load returns originalContent
|
|
302
|
+
// during build urls info are reused and load returns originalUrl/originalContent
|
|
303
|
+
urlInfo.originalUrl = originalUrl || urlInfo.originalUrl
|
|
302
304
|
urlInfo.originalContent =
|
|
303
305
|
originalContent === undefined ? content : originalContent
|
|
304
306
|
urlInfo.content = content
|
|
@@ -618,6 +620,44 @@ export const createKitchen = ({
|
|
|
618
620
|
return [ref, urlInfo]
|
|
619
621
|
}
|
|
620
622
|
|
|
623
|
+
const fetchOriginalUrlInfo = async ({
|
|
624
|
+
urlInfo,
|
|
625
|
+
context,
|
|
626
|
+
searchParam,
|
|
627
|
+
expectedType,
|
|
628
|
+
}) => {
|
|
629
|
+
const urlObject = new URL(urlInfo.url)
|
|
630
|
+
const { searchParams } = urlObject
|
|
631
|
+
if (!searchParams.has(searchParam)) {
|
|
632
|
+
return null
|
|
633
|
+
}
|
|
634
|
+
searchParams.delete(searchParam)
|
|
635
|
+
const originalUrl = urlObject.href
|
|
636
|
+
const originalReference = {
|
|
637
|
+
...(context.reference.original || context.reference),
|
|
638
|
+
expectedType,
|
|
639
|
+
}
|
|
640
|
+
originalReference.url = originalUrl
|
|
641
|
+
const originalUrlInfo = context.urlGraph.reuseOrCreateUrlInfo(
|
|
642
|
+
originalReference.url,
|
|
643
|
+
)
|
|
644
|
+
if (originalUrlInfo.originalUrl === undefined) {
|
|
645
|
+
applyReferenceEffectsOnUrlInfo(
|
|
646
|
+
originalReference,
|
|
647
|
+
originalUrlInfo,
|
|
648
|
+
context,
|
|
649
|
+
)
|
|
650
|
+
}
|
|
651
|
+
await context.fetchUrlContent(originalUrlInfo, {
|
|
652
|
+
reference: originalReference,
|
|
653
|
+
})
|
|
654
|
+
if (originalUrlInfo.dependents.size === 0) {
|
|
655
|
+
context.urlGraph.deleteUrlInfo(originalUrlInfo.url)
|
|
656
|
+
}
|
|
657
|
+
return originalUrlInfo
|
|
658
|
+
}
|
|
659
|
+
kitchenContext.fetchOriginalUrlInfo = fetchOriginalUrlInfo
|
|
660
|
+
|
|
621
661
|
return {
|
|
622
662
|
pluginController,
|
|
623
663
|
urlInfoTransformer,
|
|
@@ -664,6 +704,8 @@ const applyReferenceEffectsOnUrlInfo = (reference, urlInfo, context) => {
|
|
|
664
704
|
if (reference.shouldHandle) {
|
|
665
705
|
urlInfo.shouldHandle = true
|
|
666
706
|
}
|
|
707
|
+
urlInfo.originalUrl = urlInfo.originalUrl || reference.url
|
|
708
|
+
|
|
667
709
|
Object.assign(urlInfo.data, reference.data)
|
|
668
710
|
Object.assign(urlInfo.timing, reference.timing)
|
|
669
711
|
if (reference.injected) {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
serveDirectory,
|
|
4
4
|
composeTwoResponses,
|
|
5
5
|
} from "@jsenv/server"
|
|
6
|
-
import { urlIsInsideOf, moveUrl } from "@jsenv/
|
|
6
|
+
import { urlIsInsideOf, moveUrl } from "@jsenv/urls"
|
|
7
7
|
|
|
8
8
|
import { parseUserAgentHeader } from "./user_agent.js"
|
|
9
9
|
|
|
@@ -143,7 +143,7 @@ export const createFileService = ({
|
|
|
143
143
|
body: urlInfo.content,
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
if (code === "
|
|
146
|
+
if (code === "DIRECTORY_REFERENCE_NOT_ALLOWED") {
|
|
147
147
|
return serveDirectory(reference.url, {
|
|
148
148
|
headers: {
|
|
149
149
|
accept: "text/html",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { bufferToEtag
|
|
1
|
+
import { bufferToEtag } from "@jsenv/filesystem"
|
|
2
|
+
import { urlToRelativeUrl } from "@jsenv/urls"
|
|
2
3
|
|
|
3
4
|
import { composeTwoSourcemaps } from "@jsenv/utils/sourcemap/sourcemap_composition_v3.js"
|
|
4
5
|
import {
|
|
@@ -34,14 +35,14 @@ export const createUrlInfoTransformer = ({
|
|
|
34
35
|
))
|
|
35
36
|
if (sourcemap.sources && sourcemap.sources.length > 1) {
|
|
36
37
|
sourcemap.sources = sourcemap.sources.map(
|
|
37
|
-
(source) => new URL(source, urlInfo.
|
|
38
|
+
(source) => new URL(source, urlInfo.originalUrl).href,
|
|
38
39
|
)
|
|
39
40
|
if (!wantSourcesContent) {
|
|
40
41
|
sourcemap.sourcesContent = undefined
|
|
41
42
|
}
|
|
42
43
|
return sourcemap
|
|
43
44
|
}
|
|
44
|
-
sourcemap.sources = [urlInfo.
|
|
45
|
+
sourcemap.sources = [urlInfo.originalUrl]
|
|
45
46
|
sourcemap.sourcesContent = [urlInfo.originalContent]
|
|
46
47
|
if (!wantSourcesContent) {
|
|
47
48
|
sourcemap.sourcesContent = undefined
|
|
@@ -74,6 +75,7 @@ export const createUrlInfoTransformer = ({
|
|
|
74
75
|
|
|
75
76
|
// already loaded during "load" hook (happens during build)
|
|
76
77
|
if (urlInfo.sourcemap) {
|
|
78
|
+
urlInfo.sourcemap = normalizeSourcemap(urlInfo, urlInfo.sourcemap)
|
|
77
79
|
return
|
|
78
80
|
}
|
|
79
81
|
// check for existing sourcemap for this content
|
|
@@ -92,8 +94,9 @@ export const createUrlInfoTransformer = ({
|
|
|
92
94
|
})
|
|
93
95
|
try {
|
|
94
96
|
await context.cook(sourcemapUrlInfo, { reference: sourcemapReference })
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
+
const sourcemapRaw = JSON.parse(sourcemapUrlInfo.content)
|
|
98
|
+
const sourcemap = normalizeSourcemap(urlInfo, sourcemapRaw)
|
|
99
|
+
urlInfo.sourcemap = sourcemap
|
|
97
100
|
} catch (e) {
|
|
98
101
|
logger.error(`Error while handling existing sourcemap: ${e.message}`)
|
|
99
102
|
return
|
|
@@ -146,7 +149,7 @@ export const createUrlInfoTransformer = ({
|
|
|
146
149
|
if (sourcemapsRelativeSources) {
|
|
147
150
|
sourcemap.sources = sourcemap.sources.map((source) => {
|
|
148
151
|
const sourceRelative = urlToRelativeUrl(source, urlInfo.url)
|
|
149
|
-
return sourceRelative
|
|
152
|
+
return sourceRelative || "."
|
|
150
153
|
})
|
|
151
154
|
}
|
|
152
155
|
sourcemapUrlInfo.content = JSON.stringify(sourcemap, null, " ")
|
|
@@ -163,6 +166,9 @@ export const createUrlInfoTransformer = ({
|
|
|
163
166
|
: sourcemapReference.generatedSpecifier,
|
|
164
167
|
})
|
|
165
168
|
}
|
|
169
|
+
} else if (urlInfo.sourcemapReference) {
|
|
170
|
+
// in the end we don't use the sourcemap placeholder
|
|
171
|
+
urlGraph.deleteUrlInfo(urlInfo.sourcemapReference.url)
|
|
166
172
|
}
|
|
167
173
|
urlInfo.contentEtag = bufferToEtag(Buffer.from(urlInfo.content))
|
|
168
174
|
}
|
package/src/omega/url_graph.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { urlToRelativeUrl } from "@jsenv/
|
|
1
|
+
import { urlToRelativeUrl } from "@jsenv/urls"
|
|
2
2
|
import { urlSpecifierEncoding } from "./url_specifier_encoding.js"
|
|
3
3
|
|
|
4
4
|
export const createUrlGraph = ({
|
|
@@ -184,8 +184,9 @@ const createUrlInfo = (url) => {
|
|
|
184
184
|
subtype: undefined, // "worker", "service_worker", "shared_worker" for js, otherwise undefined
|
|
185
185
|
contentType: "", // "text/html", "text/css", "text/javascript", "application/json", ...
|
|
186
186
|
url,
|
|
187
|
-
|
|
187
|
+
originalUrl: undefined,
|
|
188
188
|
generatedUrl: null,
|
|
189
|
+
filename: "",
|
|
189
190
|
isInline: false,
|
|
190
191
|
inlineUrlSite: null,
|
|
191
192
|
shouldHandle: undefined,
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { pathToFileURL } from "node:url"
|
|
2
|
-
import {
|
|
3
|
-
isFileSystemPath,
|
|
4
|
-
normalizeStructuredMetaMap,
|
|
5
|
-
urlToMeta,
|
|
6
|
-
} from "@jsenv/filesystem"
|
|
2
|
+
import { isFileSystemPath, URL_META } from "@jsenv/urls"
|
|
7
3
|
import { createDetailedMessage } from "@jsenv/logger"
|
|
8
4
|
|
|
9
5
|
import { babelHelperNameFromUrl } from "@jsenv/babel-plugins"
|
|
@@ -145,17 +141,12 @@ const rollupPluginJsenv = ({
|
|
|
145
141
|
}
|
|
146
142
|
let importCanBeBundled = () => true
|
|
147
143
|
if (include) {
|
|
148
|
-
const
|
|
149
|
-
{
|
|
150
|
-
bundle: include,
|
|
151
|
-
},
|
|
144
|
+
const associations = URL_META.resolveAssociations(
|
|
145
|
+
{ bundle: include },
|
|
152
146
|
rootDirectoryUrl,
|
|
153
147
|
)
|
|
154
148
|
importCanBeBundled = (url) => {
|
|
155
|
-
return
|
|
156
|
-
url,
|
|
157
|
-
structuredMetaMap: bundleIncludeConfig,
|
|
158
|
-
}).bundle
|
|
149
|
+
return URL_META.applyAssociations({ url, associations }).bundle
|
|
159
150
|
}
|
|
160
151
|
}
|
|
161
152
|
const urlImporters = {}
|
|
@@ -4,10 +4,11 @@ import {
|
|
|
4
4
|
urlIsInsideOf,
|
|
5
5
|
urlToRelativeUrl,
|
|
6
6
|
urlToExtension,
|
|
7
|
-
|
|
7
|
+
urlToFilename,
|
|
8
|
+
ensurePathnameTrailingSlash,
|
|
9
|
+
} from "@jsenv/urls"
|
|
8
10
|
|
|
9
11
|
import { applyFileSystemMagicResolution } from "@jsenv/node-esm-resolution"
|
|
10
|
-
import { ensurePathnameTrailingSlash } from "@jsenv/utils/urls/url_utils.js"
|
|
11
12
|
import { CONTENT_TYPE } from "@jsenv/utils/content_type/content_type.js"
|
|
12
13
|
|
|
13
14
|
export const jsenvPluginFileUrls = ({
|
|
@@ -53,32 +54,30 @@ export const jsenvPluginFileUrls = ({
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
const { search, hash } = urlObject
|
|
56
|
-
const resolveSymlink = (fileUrl) => {
|
|
57
|
-
const realPath = realpathSync(new URL(fileUrl))
|
|
58
|
-
const realFileUrl = `${pathToFileURL(realPath)}${search}${hash}`
|
|
59
|
-
return realFileUrl
|
|
60
|
-
}
|
|
61
|
-
|
|
62
57
|
let { pathname } = urlObject
|
|
63
58
|
const pathnameUsesTrailingSlash = pathname.endsWith("/")
|
|
64
59
|
urlObject.search = ""
|
|
65
60
|
urlObject.hash = ""
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
: resolveSymlink(urlObject.href)
|
|
76
|
-
}
|
|
77
|
-
// give a chane to magic resolution if enabled
|
|
78
|
-
} else if (pathnameUsesTrailingSlash) {
|
|
79
|
-
// a warning would be great because it's strange to reference a file with a trailing slash
|
|
61
|
+
const foundADirectory = stat && stat.isDirectory()
|
|
62
|
+
const foundSomething = stat && !foundADirectory
|
|
63
|
+
// force trailing slash on directories
|
|
64
|
+
if (foundADirectory && !pathnameUsesTrailingSlash) {
|
|
65
|
+
urlObject.pathname = `${pathname}/`
|
|
66
|
+
}
|
|
67
|
+
// otherwise remove trailing slash if any
|
|
68
|
+
if (foundSomething && pathnameUsesTrailingSlash) {
|
|
69
|
+
// a warning here? (because it's strange to reference a file with a trailing slash)
|
|
80
70
|
urlObject.pathname = pathname.slice(0, -1)
|
|
81
71
|
}
|
|
72
|
+
if (foundADirectory && directoryReferenceAllowed) {
|
|
73
|
+
reference.data.foundADirectory = true
|
|
74
|
+
const directoryFacadeUrl = urlObject.href
|
|
75
|
+
const directoryUrlRaw = preservesSymlink
|
|
76
|
+
? directoryFacadeUrl
|
|
77
|
+
: resolveSymlink(directoryFacadeUrl)
|
|
78
|
+
const directoryUrl = `${directoryUrlRaw}${search}${hash}`
|
|
79
|
+
return directoryUrl
|
|
80
|
+
}
|
|
82
81
|
const url = urlObject.href
|
|
83
82
|
const filesystemResolution = applyFileSystemMagicResolution(url, {
|
|
84
83
|
fileStat: stat,
|
|
@@ -89,11 +88,16 @@ export const jsenvPluginFileUrls = ({
|
|
|
89
88
|
),
|
|
90
89
|
})
|
|
91
90
|
if (!filesystemResolution.found) {
|
|
91
|
+
reference.data.foundADirectory = foundADirectory
|
|
92
92
|
return null
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
reference.data.foundADirectory = filesystemResolution.isDirectory
|
|
95
|
+
const fileFacadeUrl = filesystemResolution.url
|
|
96
|
+
const fileUrlRaw = preservesSymlink
|
|
97
|
+
? fileFacadeUrl
|
|
98
|
+
: resolveSymlink(fileFacadeUrl)
|
|
95
99
|
const fileUrl = `${fileUrlRaw}${search}${hash}`
|
|
96
|
-
return
|
|
100
|
+
return fileUrl
|
|
97
101
|
},
|
|
98
102
|
},
|
|
99
103
|
{
|
|
@@ -149,21 +153,27 @@ export const jsenvPluginFileUrls = ({
|
|
|
149
153
|
return null
|
|
150
154
|
}
|
|
151
155
|
const urlObject = new URL(urlInfo.url)
|
|
152
|
-
if (context.reference.
|
|
156
|
+
if (context.reference.data.foundADirectory) {
|
|
153
157
|
if (directoryReferenceAllowed) {
|
|
154
158
|
const directoryEntries = readdirSync(urlObject)
|
|
159
|
+
let filename
|
|
160
|
+
if (context.reference.type === "filesystem") {
|
|
161
|
+
const parentUrlInfo = context.urlGraph.getUrlInfo(
|
|
162
|
+
context.reference.parentUrl,
|
|
163
|
+
)
|
|
164
|
+
filename = `${parentUrlInfo.filename}${context.reference.specifier}/`
|
|
165
|
+
} else {
|
|
166
|
+
filename = `${urlToFilename(urlInfo.url)}/`
|
|
167
|
+
}
|
|
155
168
|
return {
|
|
156
169
|
type: "directory",
|
|
157
170
|
contentType: "application/json",
|
|
158
171
|
content: JSON.stringify(directoryEntries, null, " "),
|
|
159
|
-
filename
|
|
160
|
-
ensurePathnameTrailingSlash(urlInfo.url),
|
|
161
|
-
context.rootDirectoryUrl,
|
|
162
|
-
),
|
|
172
|
+
filename,
|
|
163
173
|
}
|
|
164
174
|
}
|
|
165
175
|
const error = new Error("found a directory on filesystem")
|
|
166
|
-
error.code = "
|
|
176
|
+
error.code = "DIRECTORY_REFERENCE_NOT_ALLOWED"
|
|
167
177
|
throw error
|
|
168
178
|
}
|
|
169
179
|
const fileBuffer = readFileSync(urlObject)
|
|
@@ -182,3 +192,7 @@ export const jsenvPluginFileUrls = ({
|
|
|
182
192
|
},
|
|
183
193
|
]
|
|
184
194
|
}
|
|
195
|
+
|
|
196
|
+
const resolveSymlink = (fileUrl) => {
|
|
197
|
+
return pathToFileURL(realpathSync(new URL(fileUrl))).href
|
|
198
|
+
}
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
removeHtmlNodeText,
|
|
19
19
|
setHtmlNodeGeneratedText,
|
|
20
20
|
} from "@jsenv/utils/html_ast/html_ast.js"
|
|
21
|
-
import { generateInlineContentUrl } from "@jsenv/
|
|
21
|
+
import { generateInlineContentUrl } from "@jsenv/urls"
|
|
22
22
|
|
|
23
23
|
export const jsenvPluginHtmlSupervisor = ({
|
|
24
24
|
logs = false,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
getHtmlNodeTextNode,
|
|
35
35
|
removeHtmlNode,
|
|
36
36
|
} from "@jsenv/utils/html_ast/html_ast.js"
|
|
37
|
-
import { generateInlineContentUrl } from "@jsenv/
|
|
37
|
+
import { generateInlineContentUrl } from "@jsenv/urls"
|
|
38
38
|
|
|
39
39
|
export const jsenvPluginImportmap = () => {
|
|
40
40
|
let finalImportmap = null
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
setHtmlNodeGeneratedText,
|
|
9
9
|
getHtmlNodeAttributeByName,
|
|
10
10
|
} from "@jsenv/utils/html_ast/html_ast.js"
|
|
11
|
-
import { generateInlineContentUrl } from "@jsenv/
|
|
11
|
+
import { generateInlineContentUrl } from "@jsenv/urls"
|
|
12
12
|
import { CONTENT_TYPE } from "@jsenv/utils/content_type/content_type.js"
|
|
13
13
|
|
|
14
14
|
export const jsenvPluginHtmlInlineContent = ({ analyzeConvertedScripts }) => {
|
|
@@ -2,13 +2,13 @@ import { CONTENT_TYPE } from "@jsenv/utils/content_type/content_type.js"
|
|
|
2
2
|
import { createMagicSource } from "@jsenv/utils/sourcemap/magic_source.js"
|
|
3
3
|
import { JS_QUOTES } from "@jsenv/utils/string/js_quotes.js"
|
|
4
4
|
import { applyBabelPlugins } from "@jsenv/utils/js_ast/apply_babel_plugins.js"
|
|
5
|
-
import { generateInlineContentUrl } from "@jsenv/
|
|
5
|
+
import { generateInlineContentUrl } from "@jsenv/urls"
|
|
6
6
|
|
|
7
7
|
export const jsenvPluginJsInlineContent = ({ allowEscapeForVersioning }) => {
|
|
8
8
|
const parseAndTransformInlineContentCalls = async (urlInfo, context) => {
|
|
9
9
|
const inlineContentInfos = await parseJsInlineContentInfos({
|
|
10
10
|
js: urlInfo.content,
|
|
11
|
-
url:
|
|
11
|
+
url: urlInfo.originalUrl,
|
|
12
12
|
isJsModule: urlInfo.type === "js_module",
|
|
13
13
|
})
|
|
14
14
|
if (inlineContentInfos.length === 0) {
|
|
@@ -83,7 +83,7 @@ const parseJsInlineContentInfos = async ({ js, url, isJsModule }) => {
|
|
|
83
83
|
const { metadata } = await applyBabelPlugins({
|
|
84
84
|
babelPlugins: [babelPluginMetadataInlineContents],
|
|
85
85
|
urlInfo: {
|
|
86
|
-
url,
|
|
86
|
+
originalUrl: url,
|
|
87
87
|
type: isJsModule ? "js_module" : "js_classic",
|
|
88
88
|
content: js,
|
|
89
89
|
},
|
|
@@ -12,14 +12,13 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { createRequire } from "node:module"
|
|
15
|
-
import {
|
|
15
|
+
import { urlToFilename, injectQueryParams } from "@jsenv/urls"
|
|
16
|
+
import { readFileSync } from "@jsenv/filesystem"
|
|
16
17
|
|
|
17
18
|
import { requireBabelPlugin } from "@jsenv/babel-plugins"
|
|
18
19
|
import { applyBabelPlugins } from "@jsenv/utils/js_ast/apply_babel_plugins.js"
|
|
19
|
-
import { injectQueryParams } from "@jsenv/utils/urls/url_utils.js"
|
|
20
20
|
import { createMagicSource } from "@jsenv/utils/sourcemap/magic_source.js"
|
|
21
21
|
import { composeTwoSourcemaps } from "@jsenv/utils/sourcemap/sourcemap_composition_v3.js"
|
|
22
|
-
import { fetchOriginalUrlInfo } from "@jsenv/utils/graph/fetch_original_url_info.js"
|
|
23
22
|
|
|
24
23
|
import { babelPluginTransformImportMetaUrl } from "./helpers/babel_plugin_transform_import_meta_url.js"
|
|
25
24
|
import { jsenvPluginAsJsClassicHtml } from "./jsenv_plugin_as_js_classic_html.js"
|
|
@@ -92,7 +91,7 @@ const jsenvPluginAsJsClassicConversion = ({
|
|
|
92
91
|
},
|
|
93
92
|
},
|
|
94
93
|
fetchUrlContent: async (urlInfo, context) => {
|
|
95
|
-
const originalUrlInfo = await fetchOriginalUrlInfo({
|
|
94
|
+
const originalUrlInfo = await context.fetchOriginalUrlInfo({
|
|
96
95
|
urlInfo,
|
|
97
96
|
context,
|
|
98
97
|
searchParam: "as_js_classic",
|
|
@@ -126,6 +125,8 @@ const jsenvPluginAsJsClassicConversion = ({
|
|
|
126
125
|
})
|
|
127
126
|
urlInfo.data.jsClassicFormat = jsClassicFormat
|
|
128
127
|
return {
|
|
128
|
+
originalUrl: originalUrlInfo.originalUrl,
|
|
129
|
+
originalContent: originalUrlInfo.originalContent,
|
|
129
130
|
type: "js_classic",
|
|
130
131
|
contentType: "text/javascript",
|
|
131
132
|
content,
|
|
@@ -192,18 +193,21 @@ const convertJsModuleToJsClassic = async ({
|
|
|
192
193
|
],
|
|
193
194
|
urlInfo,
|
|
194
195
|
})
|
|
196
|
+
let sourcemap = urlInfo.sourcemap
|
|
197
|
+
sourcemap = await composeTwoSourcemaps(sourcemap, map)
|
|
195
198
|
if (systemJsInjection && jsClassicFormat === "system" && isJsEntryPoint) {
|
|
196
199
|
const magicSource = createMagicSource(code)
|
|
197
200
|
const systemjsCode = readFileSync(systemJsClientFileUrl, { as: "string" })
|
|
198
201
|
magicSource.prepend(`${systemjsCode}\n\n`)
|
|
199
|
-
const
|
|
202
|
+
const magicResult = magicSource.toContentAndSourcemap()
|
|
203
|
+
sourcemap = await composeTwoSourcemaps(sourcemap, magicResult.sourcemap)
|
|
200
204
|
return {
|
|
201
|
-
content,
|
|
202
|
-
sourcemap
|
|
205
|
+
content: magicResult.content,
|
|
206
|
+
sourcemap,
|
|
203
207
|
}
|
|
204
208
|
}
|
|
205
209
|
return {
|
|
206
210
|
content: code,
|
|
207
|
-
sourcemap
|
|
211
|
+
sourcemap,
|
|
208
212
|
}
|
|
209
213
|
}
|
|
@@ -11,8 +11,10 @@ import {
|
|
|
11
11
|
injectScriptAsEarlyAsPossible,
|
|
12
12
|
createHtmlNode,
|
|
13
13
|
} from "@jsenv/utils/html_ast/html_ast.js"
|
|
14
|
-
import {
|
|
15
|
-
|
|
14
|
+
import {
|
|
15
|
+
generateInlineContentUrl,
|
|
16
|
+
injectQueryParamsIntoSpecifier,
|
|
17
|
+
} from "@jsenv/urls"
|
|
16
18
|
|
|
17
19
|
export const jsenvPluginAsJsClassicHtml = ({
|
|
18
20
|
systemJsInjection,
|
|
@@ -10,11 +10,9 @@
|
|
|
10
10
|
* But for now (as it is simpler) we let the browser throw the error
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { urlToFilename } from "@jsenv/
|
|
13
|
+
import { urlToFilename, injectQueryParams } from "@jsenv/urls"
|
|
14
14
|
|
|
15
|
-
import { injectQueryParams } from "@jsenv/utils/urls/url_utils.js"
|
|
16
15
|
import { JS_QUOTES } from "@jsenv/utils/string/js_quotes.js"
|
|
17
|
-
import { fetchOriginalUrlInfo } from "@jsenv/utils/graph/fetch_original_url_info.js"
|
|
18
16
|
|
|
19
17
|
export const jsenvPluginImportAssertions = () => {
|
|
20
18
|
const updateReference = (reference, searchParam) => {
|
|
@@ -89,7 +87,7 @@ const jsenvPluginAsModules = () => {
|
|
|
89
87
|
name: `jsenv:as_json_module`,
|
|
90
88
|
appliesDuring: "*",
|
|
91
89
|
fetchUrlContent: async (urlInfo, context) => {
|
|
92
|
-
const originalUrlInfo = await fetchOriginalUrlInfo({
|
|
90
|
+
const originalUrlInfo = await context.fetchOriginalUrlInfo({
|
|
93
91
|
urlInfo,
|
|
94
92
|
context,
|
|
95
93
|
searchParam: "as_json_module",
|
|
@@ -100,6 +98,8 @@ const jsenvPluginAsModules = () => {
|
|
|
100
98
|
}
|
|
101
99
|
const jsonText = JSON.stringify(originalUrlInfo.content.trim())
|
|
102
100
|
return {
|
|
101
|
+
originalUrl: originalUrlInfo.originalUrl,
|
|
102
|
+
originalContent: originalUrlInfo.originalContent,
|
|
103
103
|
type: "js_module",
|
|
104
104
|
contentType: "text/javascript",
|
|
105
105
|
// here we could `export default ${jsonText}`:
|
|
@@ -114,7 +114,7 @@ const jsenvPluginAsModules = () => {
|
|
|
114
114
|
name: `jsenv:as_css_module`,
|
|
115
115
|
appliesDuring: "*",
|
|
116
116
|
fetchUrlContent: async (urlInfo, context) => {
|
|
117
|
-
const originalUrlInfo = await fetchOriginalUrlInfo({
|
|
117
|
+
const originalUrlInfo = await context.fetchOriginalUrlInfo({
|
|
118
118
|
urlInfo,
|
|
119
119
|
context,
|
|
120
120
|
searchParam: "as_css_module",
|
|
@@ -130,6 +130,8 @@ const jsenvPluginAsModules = () => {
|
|
|
130
130
|
canUseTemplateString: true,
|
|
131
131
|
})
|
|
132
132
|
return {
|
|
133
|
+
originalUrl: originalUrlInfo.originalUrl,
|
|
134
|
+
originalContent: originalUrlInfo.originalContent,
|
|
133
135
|
type: "js_module",
|
|
134
136
|
contentType: "text/javascript",
|
|
135
137
|
content: `import { InlineContent } from ${JSON.stringify(
|
|
@@ -148,7 +150,7 @@ const jsenvPluginAsModules = () => {
|
|
|
148
150
|
name: `jsenv:as_text_module`,
|
|
149
151
|
appliesDuring: "*",
|
|
150
152
|
fetchUrlContent: async (urlInfo, context) => {
|
|
151
|
-
const originalUrlInfo = await fetchOriginalUrlInfo({
|
|
153
|
+
const originalUrlInfo = await context.fetchOriginalUrlInfo({
|
|
152
154
|
urlInfo,
|
|
153
155
|
context,
|
|
154
156
|
searchParam: "as_text_module",
|
|
@@ -164,6 +166,8 @@ const jsenvPluginAsModules = () => {
|
|
|
164
166
|
canUseTemplateString: true,
|
|
165
167
|
})
|
|
166
168
|
return {
|
|
169
|
+
originalUrl: originalUrlInfo.originalUrl,
|
|
170
|
+
originalContent: originalUrlInfo.originalContent,
|
|
167
171
|
type: "js_module",
|
|
168
172
|
contentType: "text/javascript",
|
|
169
173
|
content: `import { InlineContent } from ${JSON.stringify(
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import { htmlAttributeSrcSet } from "@jsenv/utils/html_ast/html_attribute_src_set.js"
|
|
9
9
|
|
|
10
10
|
export const parseAndTransformHtmlUrls = async (urlInfo, context) => {
|
|
11
|
-
const url = urlInfo.
|
|
11
|
+
const url = urlInfo.originalUrl
|
|
12
12
|
const content = urlInfo.content
|
|
13
13
|
const { scenario, referenceUtils } = context
|
|
14
14
|
const htmlAst = parseHtmlString(content, {
|
|
@@ -5,7 +5,7 @@ import { isWebWorkerUrlInfo } from "@jsenv/core/src/omega/web_workers.js"
|
|
|
5
5
|
export const parseAndTransformJsUrls = async (urlInfo, context) => {
|
|
6
6
|
const jsMentions = await parseJsUrls({
|
|
7
7
|
js: urlInfo.content,
|
|
8
|
-
url:
|
|
8
|
+
url: urlInfo.originalUrl,
|
|
9
9
|
isJsModule: urlInfo.type === "js_module",
|
|
10
10
|
isWebWorker: isWebWorkerUrlInfo(urlInfo),
|
|
11
11
|
})
|