[英]How to do a Next.js Build and Export WIthout Minification and Optimization
How can I do a Next.js build and export without minifying and optimizing the output files?如何在不缩小和优化输出文件的情况下构建和导出 Next.js?
For compression, you would open your next.config.js
and set it to false:对于压缩,您将打开
next.config.js
并将其设置为 false:
module.exports = {
compress: false,
}
And for minify, you would do it in your webpack.config.js:对于缩小,您可以在 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.使用
next@^12.0.0
将产生未缩小的 HTML、JS 和一些 CSS。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.