unclear for workbox-recipes, htmlMinifier with create-wmr
See original GitHub issueFor workbox-recipes, you said in the doc https://github.com/preactjs/wmr/tree/main/packages/sw-plugin#usage
So, do we need yarn add workbox-recipes
?
In your demo, it seems like we need to install it. Maybe add a sentence to make it clear.
After using create-wmr, we have defineConfig
and in package.json
we have rollup-plugin-html-minifier
.
And in https://github.com/preactjs/wmr/wiki/Configuration-Recipes#minifying-html,
we should add plugins: [htmlMinifier()]
to defineConfig
,
but we didn’t see plugins: [htmlMinifier()]
in default defineConfig
.
It’s unnecessary to add it?
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
GitHub - minify HTML, CSS and JS code using terser - GitHub
HTMLMinifier is a highly configurable, well-tested, JavaScript-based HTML minifier. Installation. From NPM for use as a command line app: npm install html- ...
Read more >html-minifier - npm
Highly configurable, well-tested, JavaScript-based HTML minifier.. Latest version: 4.0.0, last published: 4 years ago.
Read more >Html minifier in client side [closed] - javascript - Stack Overflow
My project is a webapp who generate html template dynamically with form value. – ZecKa. Dec 17, 2020 at 15:22. You could modify ......
Read more >Top 5 html-minifier Code Examples - Snyk
Learn more about how to use html-minifier, based on html-minifier code examples created from the most popular ways it is used in public...
Read more >Experimenting with HTML minifier - Perfection Kills
In Optimizing HTML, I mentioned that state of HTML minifiers is rather ... Javascript-based HTML minifier and created an online-based tool, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I should say that adding
rollup-plugin-html-minifier
to your plugins by itself will do nothing; we already minify according to its defaults. You can customize the options of that plugin to minify further, but those are things it has not enabled by default for various reasons.Now, what content can be minified is a bit limited as prerendering happens after the build, so you can’t actually use that plugin to minify most of your HTML further, unfortunately. If you set
removeAttributeQuotes
, for example, you’ll only see that effect the content already in yourindex.html
. It won’t minify anything that’s created from the prerender.Yes, you will. You’re right, probably worth adding.
preact-compat
is legacy compat, only for use in Preact v8 and older. In v10, compat moved into the main package. hencepreact/compat
. 1 less install for users.https://preactjs.com/guide/v10/upgrade-guide#compat-has-moved-to-core
The
defineConfig
that comes in the template is empty, but you can add additional keys. See https://wmr.dev/docs/configuration