Adminator-admin-dashboard icon indicating copy to clipboard operation
Adminator-admin-dashboard copied to clipboard

Pages are minified after build

Open sandervandegeijn opened this issue 7 years ago • 4 comments
trafficstars

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 :)

sandervandegeijn avatar Mar 04 '18 19:03 sandervandegeijn

This is one problem lot of us are facing! You can simply not use the template if you don't use node/npm :(

ronyyu avatar Mar 05 '18 06:03 ronyyu

Or, you could use this website to "unminify" it => link

kipox93 avatar Mar 05 '18 09:03 kipox93

That's the way I do it as well. It works but it is less than ideal :)

sandervandegeijn avatar Mar 05 '18 09:03 sandervandegeijn

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,
        });
    }
});

jepperaskdk avatar Jul 06 '19 22:07 jepperaskdk

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.

jepperaskdk avatar Sep 06 '22 15:09 jepperaskdk