Adminator-admin-dashboard
Adminator-admin-dashboard copied to clipboard
Pages are minified after build
The html pages have already been minified, while this makes sense for a production deployment, at development time this makes it hard. I need to format the html to be able to work with the templates.
Minifying is something the developer should do when distributing his application imho :)
This is one problem lot of us are facing! You can simply not use the template if you don't use node/npm :(
Or, you could use this website to "unminify" it => link
That's the way I do it as well. It works but it is less than ideal :)
You could update webpack/plugins/htmlPlugin.js to something like this:
module.exports = Object.keys(titles).map(title => {
if (manifest.IS_PRODUCTION) {
return new HtmlWebpackPlugin({
template: path.join(manifest.paths.src, `${title}.html`),
path: manifest.paths.build,
filename: `${title}.html`,
inject: true,
minify: {
collapseWhitespace: true,
minifyCSS: true,
minifyJS: true,
removeComments: true,
useShortDoctype: true,
},
});
} else {
return new HtmlWebpackPlugin({
template: path.join(manifest.paths.src, `${title}.html`),
path: manifest.paths.build,
filename: `${title}.html`,
inject: true,
});
}
});
From 2.0.3 we prebuild both minified and unminified static assets for each release: https://github.com/puikinsh/Adminator-admin-dashboard/releases
You can build these yourself as well, using npm run release:unminified or npm run release:minified.