Closed abdonrd closed 3 years ago
I'm not sure I fully understand what you mean. Can you explain in detail what you mean?
Sure! Since Terser v5's minify function is asynchronous, I have tried to use it here: https://github.com/open-wc/open-wc/pull/1832#discussion_r486892866
But it doesn't work: https://app.circleci.com/pipelines/github/open-wc/open-wc/6693/workflows/0ab53976-0127-4ad0-aa37-87bd94861171/jobs/10546
It's the same error as:
Also related:
Right, this is why we have to change and adapt code and properly test this. But I have not much time at the moment for working on this opensource project and more important things to work on.
PRs are very welcome.
But afaik @evilebottnawi
wanted to create a fork and push this forward (the migration to Terser 5).
Not sure if we should use one of these or adjust the current code as needed.
@evilebottnawi where do you have a fork with the migration? Thanks in advance!
@abdonrd no right now, we want to start implementation html-minimizer-webpack-plugin
at the end of month, that's when i wanted to start creating fork
Hi,
We use this lib in Docusaurus (the doc site powering... Terser doc 🤪 ) and are affected by a weird bug where this lib tries to use Terser 5, only in yarn monorepo setups where another package use some other terser version (https://github.com/facebook/docusaurus/issues/3515#issuecomment-707119463).
(undefined) TypeError: Cannot read property 'replace' of undefined
at Object.options.minifyJS (main:18614:28)
at Object.chars (main:19102:24)
at main:48074:19
at String.replace (<anonymous>)
at new HTMLParser (main:48066:19)
at minify (main:18888:3)
at module.exports.exports.minify (main:19249:16)
at serverEntry_render (main:87667:38)
Probably not the fault of this lib (maybe a weird Yarn hoisting bug), but we'd appreciate the ability to use Terser v5 and ensure there's an await Terser.minify()
to properly read the v5 promise, as that would probably solve our weird Yarn workspace issue + also allow to move to using only Terser v5 instead of a mix of v4 + v5.
Unfortunately can't dedicate time to help on this migration, but willing to be an early adopter as soon as there's a Terser v5 release :)
html-minifier-terser v6.0.0 has been released now: https://www.npmjs.com/package/html-minifier-terser
If someone wants to help with the changelog, that would be great.
https://github.com/terser/html-minifier-terser/releases/tag/v6.0.0
shouldn't this issue be closed?
I just tried implementing CSS minification with remote importing of @import statements.
I found this issue and thought that minifyCSS should support async opperations.
But then also found that it does not?
The minifyJS does implement async?
The minifyCSS does not?
Am I missing something? Would this be a new issue to be opened?
Hi. Async function for minify-css is not implemented. clean-css
is synchronous. A new issue can be opened to track async support for minify css.
@sibiraj-s I created a new issue since it would be useful for the functionality of importing remote @import
css statements: https://github.com/terser/html-minifier-terser/issues/112
Right now we can't use async functions for
minifyCSS
andminifyJS
.