@jsenv/core 31.1.4 → 31.2.0
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/main.js
CHANGED
|
@@ -10175,6 +10175,17 @@ const parseAndTransformWebmanifestUrls = async (urlInfo, context) => {
|
|
|
10175
10175
|
const content = urlInfo.content;
|
|
10176
10176
|
const manifest = JSON.parse(content);
|
|
10177
10177
|
const actions = [];
|
|
10178
|
+
const {
|
|
10179
|
+
start_url
|
|
10180
|
+
} = manifest;
|
|
10181
|
+
if (start_url) {
|
|
10182
|
+
if (context.build) {
|
|
10183
|
+
manifest.start_url = "/";
|
|
10184
|
+
} else {
|
|
10185
|
+
const parentUrl = context.reference.parentUrl;
|
|
10186
|
+
manifest.start_url = `${parentUrl.slice(context.rootDirectoryUrl.length)}`;
|
|
10187
|
+
}
|
|
10188
|
+
}
|
|
10178
10189
|
const {
|
|
10179
10190
|
icons = []
|
|
10180
10191
|
} = manifest;
|
package/package.json
CHANGED
|
@@ -2,6 +2,15 @@ export const parseAndTransformWebmanifestUrls = async (urlInfo, context) => {
|
|
|
2
2
|
const content = urlInfo.content
|
|
3
3
|
const manifest = JSON.parse(content)
|
|
4
4
|
const actions = []
|
|
5
|
+
const { start_url } = manifest
|
|
6
|
+
if (start_url) {
|
|
7
|
+
if (context.build) {
|
|
8
|
+
manifest.start_url = "/"
|
|
9
|
+
} else {
|
|
10
|
+
const parentUrl = context.reference.parentUrl
|
|
11
|
+
manifest.start_url = `${parentUrl.slice(context.rootDirectoryUrl.length)}`
|
|
12
|
+
}
|
|
13
|
+
}
|
|
5
14
|
const { icons = [] } = manifest
|
|
6
15
|
icons.forEach((icon) => {
|
|
7
16
|
const [reference] = context.referenceUtils.found({
|
|
@@ -12,6 +21,7 @@ export const parseAndTransformWebmanifestUrls = async (urlInfo, context) => {
|
|
|
12
21
|
icon.src = await context.referenceUtils.readGeneratedSpecifier(reference)
|
|
13
22
|
})
|
|
14
23
|
})
|
|
24
|
+
|
|
15
25
|
if (actions.length === 0) {
|
|
16
26
|
return null
|
|
17
27
|
}
|