You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I don't set chunkNames to include [hash] it seems my JS file is written with a module importing the entryfile (my index.html) instead of the expected ESM output:
However if I set chunkNames: '[ext]/[name]-[hash]' it outputs the js file as an ESM as expected.
In my setup, I have a conditional check so that it's just [name] if NODE_ENV == 'development' and [ext]/[name]-[hash] if it's set to production. I'm not sure what the importance of the hash is, and while the README does show it being used it doesn't explicitly state that it's necessary.
What's more, is I get weird build output from esbuild, and it looks like it's double processing the index.ts file:
(without hash)
dist/app.css 1.2kb
⚡ Done in 2ms
dist/index.js 10.6mb ⚠️
⚡ Done in 296ms
dist/index.html 957b
dist/index.js 264b
⚡ Done in 625ms
(with hash)
dist/css/app-V3MYB2PJ.css 1.2kb
⚡ Done in 2ms
dist/js/index-QJUXMFXL.js 10.6mb ⚠️
⚡ Done in 294ms
dist/index-HXAY6RKV.html 1.0kb
dist/index.js 273b
The 10.6mb (it includes inline sourcemaps, so it's big) output file is the appropriate build, and while the MUCH smaller build appears after, it only works as expected in the hashed output, and I never see a hashed index file (which is preferred, but weird it shows it being built).
Anyway, I'm going to have to hard-code the hash for now, but it's all weird compared to other plugins so I wanted to point it out, and hopefully something can be clarified out of it.
The text was updated successfully, but these errors were encountered:
When I don't set
chunkNames
to include[hash]
it seems my JS file is written with a module importing the entryfile (myindex.html
) instead of the expected ESM output:Here's the options that produce this output:
However if I set
chunkNames: '[ext]/[name]-[hash]'
it outputs the js file as an ESM as expected.In my setup, I have a conditional check so that it's just
[name]
ifNODE_ENV == 'development'
and[ext]/[name]-[hash]
if it's set toproduction
. I'm not sure what the importance of the hash is, and while theREADME
does show it being used it doesn't explicitly state that it's necessary.What's more, is I get weird build output from esbuild, and it looks like it's double processing the
index.ts
file:(without hash)
(with
hash
)The
10.6mb
(it includes inline sourcemaps, so it's big) output file is the appropriate build, and while the MUCH smaller build appears after, it only works as expected in the hashed output, and I never see a hashed index file (which is preferred, but weird it shows it being built).Anyway, I'm going to have to hard-code the hash for now, but it's all weird compared to other plugins so I wanted to point it out, and hopefully something can be clarified out of it.
The text was updated successfully, but these errors were encountered: