minifyHTML doesn't minify CSS nor JS
ngdangtu-vn opened this issue · 3 comments
According to this part Minifying HTML, the content inside <style>
and <script>
should be minified when I set both options to true. However this is the result:
<html lang=en><head><meta charset=utf-8><title>Portal Site » ngdangtu</title><meta name=description content="Welcome to my portal."><meta name=viewport content="width=device-width, initial-scale=1.0"><link rel=stylesheet href=https://res.ngdangtu.com/v0/min.css><style>
main
{
height: 70%;
width: 65%;
max-height: 600px;
max-width: 1000px;
}
</style><body><main class=col-slider></main><script>
</script>
Then I decided to take a look in the source a bit. And I changed from mod.ts
to wasm.js
to use directly minify_html()
. But it returns this trouble:
TypeError: Cannot read property '__wbindgen_export_0' of undefined
at minify_html (https://deno.land/x/minifier@v1.1.1/wasm.js:125:14)
at main.ts:23:25
Yeah, this is a problem with the build process. The minifying the css and js requires the Go compiler, which it seems it's not reading correctly when I built the project. I don't have a lot of extra time right now, so you'll probably be waiting a bit for a fix.
Ah, I just thought this haven't been discovered yet so I put a notice here. I don't mean to urge you or anything. Beside, if it is an urgent case, people can just minify each css and js and replace it with original versions. (I did it with deno_dom and it work beautiful). Therefore, this shouldn't be serious.
Though, it would be great if you don't mind me put a developing mark
on the section of README so everyone will not be confused :D
Yeah, thanks for the PR.