@jsenv/core 38.0.0 → 38.0.2
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/jsenv_core.js
CHANGED
|
@@ -8531,6 +8531,11 @@ const rollupPluginJsenv = ({
|
|
|
8531
8531
|
}
|
|
8532
8532
|
}
|
|
8533
8533
|
|
|
8534
|
+
const generatedToShareCode =
|
|
8535
|
+
!rollupFileInfo.isEntry &&
|
|
8536
|
+
!rollupFileInfo.isDynamicEntry &&
|
|
8537
|
+
!rollupFileInfo.isImplicitEntry;
|
|
8538
|
+
|
|
8534
8539
|
return {
|
|
8535
8540
|
originalUrl,
|
|
8536
8541
|
type: format === "esm" ? "js_module" : "common_js",
|
|
@@ -8541,6 +8546,7 @@ const rollupPluginJsenv = ({
|
|
|
8541
8546
|
rollupFileInfo.imports.length > 0 ||
|
|
8542
8547
|
rollupFileInfo.dynamicImports.length > 0,
|
|
8543
8548
|
isDynamicEntry: rollupFileInfo.isDynamicEntry,
|
|
8549
|
+
generatedToShareCode,
|
|
8544
8550
|
},
|
|
8545
8551
|
sourceUrls,
|
|
8546
8552
|
contentType: "text/javascript",
|
|
@@ -20696,7 +20702,7 @@ const createBuildSpecifierManager = ({
|
|
|
20696
20702
|
storeOriginalPositions: false,
|
|
20697
20703
|
});
|
|
20698
20704
|
const mutations = [];
|
|
20699
|
-
const
|
|
20705
|
+
const hintToInjectMap = new Map();
|
|
20700
20706
|
visitHtmlNodes(htmlAst, {
|
|
20701
20707
|
link: (node) => {
|
|
20702
20708
|
const href = getHtmlNodeAttribute(node, "href");
|
|
@@ -20760,12 +20766,12 @@ const createBuildSpecifierManager = ({
|
|
|
20760
20766
|
}
|
|
20761
20767
|
const referencedUrlInfo = referenceToOther.urlInfo;
|
|
20762
20768
|
if (referencedUrlInfo.data.generatedToShareCode) {
|
|
20763
|
-
|
|
20769
|
+
hintToInjectMap.set(referencedUrlInfo, { node });
|
|
20764
20770
|
}
|
|
20765
20771
|
}
|
|
20766
20772
|
},
|
|
20767
20773
|
});
|
|
20768
|
-
|
|
20774
|
+
hintToInjectMap.forEach(({ node }, urlInfo) => {
|
|
20769
20775
|
const buildGeneratedSpecifier = getBuildGeneratedSpecifier(urlInfo);
|
|
20770
20776
|
const found = findHtmlNode(htmlAst, (htmlNode) => {
|
|
20771
20777
|
return (
|
|
@@ -20777,8 +20783,8 @@ const createBuildSpecifierManager = ({
|
|
|
20777
20783
|
mutations.push(() => {
|
|
20778
20784
|
const nodeToInsert = createHtmlNode({
|
|
20779
20785
|
tagName: "link",
|
|
20780
|
-
href: buildGeneratedSpecifier,
|
|
20781
20786
|
rel: getHtmlNodeAttribute(node, "rel"),
|
|
20787
|
+
href: buildGeneratedSpecifier,
|
|
20782
20788
|
as: getHtmlNodeAttribute(node, "as"),
|
|
20783
20789
|
type: getHtmlNodeAttribute(node, "type"),
|
|
20784
20790
|
crossorigin: getHtmlNodeAttribute(node, "crossorigin"),
|
|
@@ -21174,10 +21180,14 @@ const defaultRuntimeCompat = {
|
|
|
21174
21180
|
* Directory where asset files will be written
|
|
21175
21181
|
* @param {string|url} [buildParameters.base=""]
|
|
21176
21182
|
* Urls in build file contents will be prefixed with this string
|
|
21183
|
+
* @param {boolean|object} [buildParameters.bundling=true]
|
|
21184
|
+
* Reduce number of files written in the build directory
|
|
21185
|
+
* @param {boolean|object} [buildParameters.minification=true]
|
|
21186
|
+
* Minify the content of files written into the build directory
|
|
21177
21187
|
* @param {boolean} [buildParameters.versioning=true]
|
|
21178
|
-
*
|
|
21188
|
+
* Use versioning on files written in the build directory
|
|
21179
21189
|
* @param {('search_param'|'filename')} [buildParameters.versioningMethod="search_param"]
|
|
21180
|
-
* Controls how url are versioned
|
|
21190
|
+
* Controls how url are versioned in the build directory
|
|
21181
21191
|
* @param {('none'|'inline'|'file'|'programmatic'} [buildParameters.sourcemaps="none"]
|
|
21182
21192
|
* Generate sourcemaps in the build directory
|
|
21183
21193
|
* @return {Object} buildReturnValue
|
package/package.json
CHANGED
package/src/build/build.js
CHANGED
|
@@ -70,10 +70,14 @@ export const defaultRuntimeCompat = {
|
|
|
70
70
|
* Directory where asset files will be written
|
|
71
71
|
* @param {string|url} [buildParameters.base=""]
|
|
72
72
|
* Urls in build file contents will be prefixed with this string
|
|
73
|
+
* @param {boolean|object} [buildParameters.bundling=true]
|
|
74
|
+
* Reduce number of files written in the build directory
|
|
75
|
+
* @param {boolean|object} [buildParameters.minification=true]
|
|
76
|
+
* Minify the content of files written into the build directory
|
|
73
77
|
* @param {boolean} [buildParameters.versioning=true]
|
|
74
|
-
*
|
|
78
|
+
* Use versioning on files written in the build directory
|
|
75
79
|
* @param {('search_param'|'filename')} [buildParameters.versioningMethod="search_param"]
|
|
76
|
-
* Controls how url are versioned
|
|
80
|
+
* Controls how url are versioned in the build directory
|
|
77
81
|
* @param {('none'|'inline'|'file'|'programmatic'} [buildParameters.sourcemaps="none"]
|
|
78
82
|
* Generate sourcemaps in the build directory
|
|
79
83
|
* @return {Object} buildReturnValue
|
|
@@ -767,7 +767,7 @@ export const createBuildSpecifierManager = ({
|
|
|
767
767
|
storeOriginalPositions: false,
|
|
768
768
|
});
|
|
769
769
|
const mutations = [];
|
|
770
|
-
const
|
|
770
|
+
const hintToInjectMap = new Map();
|
|
771
771
|
visitHtmlNodes(htmlAst, {
|
|
772
772
|
link: (node) => {
|
|
773
773
|
const href = getHtmlNodeAttribute(node, "href");
|
|
@@ -831,12 +831,12 @@ export const createBuildSpecifierManager = ({
|
|
|
831
831
|
}
|
|
832
832
|
const referencedUrlInfo = referenceToOther.urlInfo;
|
|
833
833
|
if (referencedUrlInfo.data.generatedToShareCode) {
|
|
834
|
-
|
|
834
|
+
hintToInjectMap.set(referencedUrlInfo, { node });
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
837
|
},
|
|
838
838
|
});
|
|
839
|
-
|
|
839
|
+
hintToInjectMap.forEach(({ node }, urlInfo) => {
|
|
840
840
|
const buildGeneratedSpecifier = getBuildGeneratedSpecifier(urlInfo);
|
|
841
841
|
const found = findHtmlNode(htmlAst, (htmlNode) => {
|
|
842
842
|
return (
|
|
@@ -848,8 +848,8 @@ export const createBuildSpecifierManager = ({
|
|
|
848
848
|
mutations.push(() => {
|
|
849
849
|
const nodeToInsert = createHtmlNode({
|
|
850
850
|
tagName: "link",
|
|
851
|
-
href: buildGeneratedSpecifier,
|
|
852
851
|
rel: getHtmlNodeAttribute(node, "rel"),
|
|
852
|
+
href: buildGeneratedSpecifier,
|
|
853
853
|
as: getHtmlNodeAttribute(node, "as"),
|
|
854
854
|
type: getHtmlNodeAttribute(node, "type"),
|
|
855
855
|
crossorigin: getHtmlNodeAttribute(node, "crossorigin"),
|