看起来这已经被回答了 on Vercel's issues board。在此处复制他们的解决方案:
这些插件是增强配置对象的功能,所以
您必须将它们包装起来,而不是将它们作为参数提供:
const withPWA = require('next-pwa')
const runtimeCaching = require('next-pwa/cache')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',});
module.exports = withBundleAnalyzer(withPWA({
pwa: {
dest: 'public',runtimeCaching,},poweredByHeader: false,}));
,
在我这样做之前,
module.exports = withBundleAnalyzer(
withPWA({
pwa: {
dest: 'public',})
)
module.exports =
{
env: {
BASE_URL: process.env.BASE_URL,future: {
webpack5: true,reactStrictMode: true,}
不确定,但我认为你应该只需要一个 module.exports
所以我把我的其他东西像这样包裹在 withBundleAnalyzer
中
module.exports = withBundleAnalyzer(
withPWA({
pwa: {
dest: 'public',}),{
env: {
BASE_URL: process.env.BASE_URL,}
)
本文链接:https://www.f2er.com/1250865.html