ntsd / sveltekit-html-minifier

Sveltekit Adapter to Minify the preload HTML page
https://www.npmjs.com/package/sveltekit-html-minifier
MIT License
6 stars 1 forks source link

Breaks production build after svelte@next.227 #6

Open ryoppippi opened 1 month ago

ryoppippi commented 1 month ago

Related issue: https://github.com/sveltejs/svelte/issues/13510

I'll create a reproduction later

ntsd commented 1 month ago

It's working fine from what I tested with the scratch project with the latest Svelte 5 version. Btw could you share your rendered HTML file? Maybe some of the attributes are removed by the 'html-minifier-terser`. You could also disable the config https://github.com/terser/html-minifier-terser#options-quick-reference.

Also, there are defaults here that could break the HTML attributes https://github.com/ntsd/sveltekit-html-minifier/blob/3ea53e2ceeb38326c2dda1723ba64d7586da2d5d/index.js#L19

sotasan commented 1 month ago

That sounds like you're removing whitespace and/or comments via the minifier, which Svelte is sensitive to. Try turning those parts off.

Originally posted by @dummdidumm in https://github.com/sveltejs/svelte/issues/13510#issuecomment-2395163959

sotasan commented 1 month ago

That sounds like you're removing whitespace and/or comments via the minifier, which Svelte is sensitive to. Try turning those parts off.

Originally posted by @dummdidumm in sveltejs/svelte#13510 (comment)

For me it was collapseWhitespace.

ntsd commented 1 month ago

It seems many people have this issue, so I decided to remove the collapse whitespace by default.

It will fixed by v1.0.4

https://github.com/ntsd/sveltekit-html-minifier/pull/7