Browser Version #109
Replies: 5 comments
-
Sure, see https://terser.org/html-minifier-terser and the relevant files at https://github.com/terser/html-minifier-terser/tree/master/demo |
Beta Was this translation helpful? Give feedback.
-
Starting v7 browser builds are distributed to npm. See https://unpkg.com/browse/html-minifier-terser@7.0.0-alpha.1/dist Prior to v7, bundles are not distributed to npm. You can use any cdn that can import files from github. You can find the files in the |
Beta Was this translation helpful? Give feedback.
-
Thank you for reply. Apologies if this seems trivial. I dev db applications (4d.com). Running example code in a headless browser I cant get past this error in the web inspector. foo ', {removeAttributeQuotes: true, });}catch(e){console.error(e);} Is the minify() the correct function to call with the source html as the first param ? |
Beta Was this translation helpful? Give feedback.
-
Minify is not added to global variables. If you are using via UMD builds, you will need to access via UMD namespace. <body>
<script src="https://cdn.jsdelivr.net/npm/html-minifier-terser@7.0.0-alpha.1/dist/htmlminifier.umd.bundle.js"></script>
<script>
const minify = window.HTMLMinifier.minify;
</script>
</body> Or For modules. <script type="module">
import HTMLMinifier from 'https://cdn.skypack.dev/html-minifier-terser';
const minify = HTMLMinifier.minify
</script> |
Beta Was this translation helpful? Give feedback.
-
Thank you for trying to help. This is offline desktop application. Testing with your example for UMD build |
Beta Was this translation helpful? Give feedback.
-
Is there a build of this that can be run client side in the browser
thanks
Beta Was this translation helpful? Give feedback.
All reactions