代码拉取完成,页面将自动刷新
/* 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;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。