1 Star 0 Fork 0

Fsj_wade/notabase_cida

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
next.config.js 1.65 KB
一键复制 编辑 原始数据 按行查看 历史
/* eslint-disable @typescript-eslint/no-var-requires */
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants');
const withPWA = require('next-pwa')({
dest: 'public',
scope: '/app/',
disable:
process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test',
dynamicStartUrlRedirect: '/login',
reloadOnOnline: false,
register: false,
skipWaiting: false,
});
const isSentryEnabled = !!(
process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN
);
const { withSentryConfig } = require('@sentry/nextjs');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const SentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
silent: true, // Suppresses all logs
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
};
const config = (phase) => {
const isDev = phase === PHASE_DEVELOPMENT_SERVER;
/**
* @type {import('next').NextConfig}
*/
let config = withPWA(
withBundleAnalyzer({
experimental: { esmExternals: true },
trailingSlash: true,
i18n: {
locales: ['en-US'],
defaultLocale: 'en-US',
},
env: {
BASE_URL: isDev ? 'http://localhost:3000' : 'https://notabase.io',
},
})
);
return config;
};
module.exports = isSentryEnabled
? withSentryConfig(config, SentryWebpackPluginOptions)
: config;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fsj2001/notabase_cida.git
git@gitee.com:fsj2001/notabase_cida.git
fsj2001
notabase_cida
notabase_cida
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385