It’s not a big thing. I just have OCD.
My site isn’t huge., Just a landing page style thing. I just have a dependency graph warning in lighthouse is all.
I could build the script with .Build but i wanted to reuse the module and chunk.
Might not be too bad to flag capture chunks, then for each group add a directory. Enabling reading the chunks per group.
I would need to figure out if a chunk is await import( or import “”. And imported from an entry point (which might make it not possible). And chunks which are shared between groups would not have to live in the group directory. From reading the docs. esbuild as current only has --chunk-names=chunks/[name]-[hash]-[ext].. But I could say it is an import if its not ^chunk-*. But then chunk would be a reserved name, probs not an issue if the hash is present mind.
Looks like it would have to be esbuild - API
{{ if ne $s.IsEntryChunk true }}
<link rel="modulepreload" href="{{$s.RelPermalink}}">
{{ end }}
i might be be missing another solution to my issue here,… will probs come to me in a few days.
In terms of speed the modules defer and push the dom content loaded forward by the module import depth * latency. Yes you can make async, but then they lose execution order.
To just create a issue. In oil rigs over starlink, it might have good improvments.
My lighthouse performance went from 98 to 96. -2.
For reference:
main.js async:→ something.js import:→ another.js
 "another.js": {
"bytes": 53,
"imports": [],
"format": "esm"
},
"something.js": {
"bytes": 174,
"imports": [
{
"path": "another.js",
"kind": "import-statement",
"original": "./another.js"
}
],
"format": "esm"
},
"main.js": {
"bytes": 119,
"imports": [
{
"path": "something.js",
"kind": "dynamic-import",
"original": "./something.js"
}
],
"format": "cjs"
}
},
"outputs": {
"dist/main.js": {
"imports": [
{
"path": "dist/chunk-L3RX5ZXO.js",
"kind": "import-statement"
},
{
"path": "dist/something-YKOR44MB.js",
"kind": "dynamic-import"
}
], [0/165]
"exports": [
"default"
],
"entryPoint": "main.js",
"inputs": {
"main.js": {
"bytesInOutput": 150
}
},
"bytes": 245
},
"dist/something-YKOR44MB.js": {
"imports": [
{
"path": "dist/chunk-L3RX5ZXO.js",
"kind": "import-statement"
}
],
"exports": [
"initialize"
],
"entryPoint": "something.js",
"inputs": {
"another.js": {
"bytesInOutput": 115
},
"something.js": {
"bytesInOutput": 200
}
},
"bytes": 437
},
"dist/chunk-L3RX5ZXO.js": {
"imports": [],
"exports": [
"__commonJS",
"__esm"
],
"inputs": {},
"bytes": 364
}
}
}