这是我的next.config.js文件,我想使用next/bundle分析器
/** @type {import('next').NextConfig} */
const withPWA = require("next-pwa")({
dest: "public",
register: true,
skipWaiting: true,
// put other next-pwa options here
});
const nextConfig = withPWA({
reactStrictMode: true,
swcMinify: true,
images: {
domains: ["*************"],
},
// put other next js options here
});
module.exports = nextConfig;现在,docs说,我需要对next.config.js文件进行一些修改,以包含env。
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
module.exports = withBundleAnalyzer({})我的问题是如何将此代码添加到现有的next.config.js文件中
发布于 2022-10-01 06:20:07
此方法返回一个config对象,尝试以下代码:
module.exports = {...withPWA({}) , ...withBundleAnalyzer({})}https://stackoverflow.com/questions/73916092
复制相似问题