2 Star 1 Fork 0

tb/daedalOS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
next.config.js 1.65 KB
一键复制 编辑 原始数据 按行查看 历史
// @ts-check
const isProduction = process.env.NODE_ENV === "production";
const bundleAnalyzer = process.env.npm_config_argv?.includes(
"build:bundle-analyzer"
);
const webpack = require("webpack");
/**
* @type {import("next").NextConfig}
* */
const nextConfig = {
compiler: {
reactRemoveProperties: isProduction,
removeConsole: isProduction,
styledComponents: {
displayName: false,
fileName: false,
minify: isProduction,
pure: true,
ssr: true,
transpileTemplateLiterals: true,
},
},
devIndicators: {
buildActivityPosition: "top-right",
},
optimizeFonts: false,
output: "export",
productionBrowserSourceMaps: false,
reactStrictMode: true,
swcMinify: true,
webpack: (config) => {
config.plugins.push(
new webpack.NormalModuleReplacementPlugin(/node:/, (resource) => {
const mod = resource.request.replace(/^node:/, "");
switch (mod) {
case "buffer":
resource.request = "buffer";
break;
case "stream":
resource.request = "readable-stream";
break;
default:
throw new Error(`Not found ${mod}`);
}
})
);
config.resolve.fallback = config.resolve.fallback || {};
config.resolve.fallback.module = false;
config.resolve.fallback.perf_hooks = false;
config.module.parser.javascript = config.module.parser.javascript || {};
config.module.parser.javascript.dynamicImportFetchPriority = "high";
return config;
},
};
module.exports = bundleAnalyzer
? require("@next/bundle-analyzer")({
enabled: isProduction,
})(nextConfig)
: nextConfig;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/yaoxian/daedalOS.git
git@gitee.com:yaoxian/daedalOS.git
yaoxian
daedalOS
daedalOS
main

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385