i have following config:
````
dev: true,
build: {
html: {
minify: {
collapseBooleanAttributes: false,
decodeEntities: false,
minifyCSS: false,
minifyJS: false,
processConditionalComments: false,
removeEmptyAttributes: false,
removeRedundantAttributes: false,
trimCustomFragments: false,
useShortDoctype: false
}
}
},
optimization: {
minimize: false,
},
generate: {
minify: false
},
````
but after running nuxt generate js files are still minified...
to not minify the generated files
files are minified
Some parts in generated html is compressed in vue-ssr side instead of generate.minify, unfortunately Vue hasn't provided a way to serve pretty html in ssr.
https://github.com/nuxt/nuxt.js/issues/2151#issuecomment-345607089
'some parts' ? its looks to mi that everything is minified... :/
If your situation is same as the link in my previous comment, the minified parts in the screenshot are all from vue-ssr
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as 馃晲Pending will not be automatically marked as stale.
any work on this issue, I also need this functionality. My Seo team also told me regarding this functionality
Webpack is doing the minification when using generate, the html.minify options seemingly do nothing.
Disable minification by adding the following to the build property's extend method:
config.optimization.minimize = false;
Hi, @clarkdo any updates?
I also need this functionality. Did you find the way how to disable html minify in build?
Hi @Akulko , have you tried build.html.minify: false ?
If so and you're only seeing minified html under <div id="__nuxt" data-server-rendered="true">, it's not controllable from Nuxt side as my above comment, because it's returned from vue ssr renderer.renderToString.
One potential way I can think is adding a hook like generate:done to use pretty tool like prettier to format html.
Hi, @clarkdo any updates?
I also need this functionality. Did you find the way how to disable html minify in build?
Please check the solution posted by @IronLionShawn, it works nicely and helped my team gain a 40% build speedup for dev environments. Just make sure to paste the snippet within the extend method that resides in your build section of the nuxt.config.js file.
Most helpful comment
Webpack is doing the minification when using generate, the
html.minifyoptions seemingly do nothing.Disable minification by adding the following to the build property's extend method:
config.optimization.minimize = false;