Closed DrSensor closed 3 years ago
@juliendargelos thank you for the plugin. I have used this plugin with @rollup/plugin-html
and work well toghether. My rollup configs is:
import html from '@rollup/plugin-html';
import htmlMinifier from 'rollup-plugin-html-minifier';
export default {
input: 'src/index.js',
output: {
file: './dist/main.js',
format: 'iife'
},
plugins: [
// generate html for serve bundle
html(),
// minify the html
htmlMinifier({
collapseWhitespace: true,
removeComments: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
useShortDoctype: true,
minifyCSS: true,
minifyJS: true
})
]
};
@DrSensor The plugin does work, but as said on the html-minifier readme:
Most of the options are disabled by default.
You need to provide some options to get an actual minification (see @ruddenchaux's answer for instance).
Somehow it doesn't minify index.html produced by @rollup/plugin-html
my config (more or less)
related https://github.com/rollup/plugins/issues/120