@jsenv/core 24.5.3 → 24.5.4
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/package.json
CHANGED
|
@@ -20,14 +20,31 @@ const fileNamePatternFromRessource = (ressource) => {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
if (ressource.urlVersioningDisabled) {
|
|
23
|
-
if (ressource
|
|
24
|
-
return
|
|
23
|
+
if (canMoveToAssetsDirectory(ressource)) {
|
|
24
|
+
return assetFileNamePatternWithoutHash
|
|
25
25
|
}
|
|
26
|
-
return
|
|
26
|
+
return `[name][extname]`
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
if (ressource
|
|
30
|
-
return
|
|
29
|
+
if (canMoveToAssetsDirectory(ressource)) {
|
|
30
|
+
return assetFileNamePattern
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return `[name]-[hash][extname]`
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const canMoveToAssetsDirectory = (ressource) => {
|
|
36
|
+
if (ressource.isEntryPoint) {
|
|
37
|
+
return false
|
|
38
|
+
}
|
|
39
|
+
// in theory js module can be moved to assets directory
|
|
40
|
+
// but that needs to be tested
|
|
41
|
+
if (ressource.isJsModule) {
|
|
42
|
+
return false
|
|
43
|
+
}
|
|
44
|
+
// service worker MUST be at the root (same level than the HTML file)
|
|
45
|
+
// otherwise it might be registered for the scope "/assets/" instead of "/"
|
|
46
|
+
if (ressource.isServiceWorker) {
|
|
47
|
+
return false
|
|
48
|
+
}
|
|
49
|
+
return true
|
|
33
50
|
}
|