How can I do a Next.js build and export without minifying and optimizing the output files?
For compression, you would open your next.config.js and set it to false:
module.exports = {
compress: false,
}
And for minify, you would do it in your webpack.config.js:
module.exports = {
//...
optimization: {
minimize: false,
},
};
next.config.js
module.exports = (nextConfig) => {
return {
...nextConfig,
webpack(webpackConfig) {
return {
...webpackConfig,
optimization: {
minimize: false
}
};
}
};
};
Using next@^12.0.0 will produce unminified HTML, JS, and somewhat CSS.