test pack

This commit is contained in:
sijinhui 2024-05-04 12:41:49 +08:00
parent 14faccb1a6
commit 942b48de69

View File

@ -1,10 +1,10 @@
import webpack from "webpack"; import webpack from "webpack";
// debug build // debug build
import { createRequire } from 'module'; // import { createRequire } from 'module';
const require = createRequire(import.meta.url); // const require = createRequire(import.meta.url);
const withBundleAnalyzer = require('@next/bundle-analyzer')({ // const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true', // enabled: process.env.ANALYZE === 'true',
}); // });
// import CssMinimizerPlugin from "css-minimizer-webpack-plugin"; // import CssMinimizerPlugin from "css-minimizer-webpack-plugin";
@ -19,7 +19,7 @@ console.log("[Next] build with chunk: ", disableChunk);
// const isProd = process.env.NODE_ENV === 'production' // const isProd = process.env.NODE_ENV === 'production'
// 为了修复tiktoken的插件问题 // 为了修复tiktoken的插件问题
const nextConfig = withBundleAnalyzer({ const nextConfig = {
// transpilePackages: ['tiktoken'], // transpilePackages: ['tiktoken'],
webpack(config) { webpack(config) {
config.module.rules.push({ config.module.rules.push({
@ -93,7 +93,7 @@ const nextConfig = withBundleAnalyzer({
// 'sharp': 'commonjs sharp' // 'sharp': 'commonjs sharp'
// }, // },
swcMinify: true, swcMinify: true,
}); };
const CorsHeaders = [ const CorsHeaders = [
{ key: "Access-Control-Allow-Credentials", value: "true" }, { key: "Access-Control-Allow-Credentials", value: "true" },