jsoncrack.com/next.config.js

56 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

2023-05-22 11:49:38 +03:00
const { withSentryConfig } = require("@sentry/nextjs");
2023-07-16 15:44:10 +03:00
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
2023-01-29 19:45:09 +03:00
2022-04-27 13:56:24 +03:00
/**
* @type {import('next').NextConfig}
*/
2023-01-29 19:45:09 +03:00
const config = {
2023-07-16 15:44:10 +03:00
output: "export",
2022-12-11 14:27:07 +03:00
reactStrictMode: false,
2023-02-09 09:22:11 +03:00
productionBrowserSourceMaps: true,
experimental: {
optimizePackageImports: ["reaflow"],
},
2023-01-28 17:17:21 +03:00
compiler: {
2023-01-29 19:45:09 +03:00
styledComponents: true,
},
webpack: (config, { isServer }) => {
2023-11-26 14:51:21 +03:00
config.resolve.fallback = { fs: false };
2024-01-05 21:49:36 +03:00
config.output.webassemblyModuleFilename = "static/wasm/[modulehash].wasm";
config.experiments = { asyncWebAssembly: true, layers: true };
if (!isServer) {
config.output.environment = { ...config.output.environment, asyncFunction: true };
}
2023-11-26 14:51:21 +03:00
return config;
},
2022-04-27 13:56:24 +03:00
};
2023-01-29 19:45:09 +03:00
const configExport = () => {
if (process.env.ANALYZE === "true") return withBundleAnalyzer(config);
2023-08-07 23:39:20 +03:00
if (process.env.GITHUB_REPOSITORY === "AykutSarac/jsoncrack.com") {
return withSentryConfig(
config,
{
silent: true,
org: "aykut-sarac",
project: "json-crack",
},
{
widenClientFileUpload: true,
hideSourceMaps: true,
disableLogger: true,
disableServerWebpackPlugin: true,
}
);
2023-08-07 23:39:20 +03:00
}
return config;
};
module.exports = configExport();