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";
// debug build
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
// import { createRequire } from 'module';
// const require = createRequire(import.meta.url);
// const withBundleAnalyzer = require('@next/bundle-analyzer')({
// enabled: process.env.ANALYZE === 'true',
// });
// 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'
// 为了修复tiktoken的插件问题
const nextConfig = withBundleAnalyzer({
const nextConfig = {
// transpilePackages: ['tiktoken'],
webpack(config) {
config.module.rules.push({
@ -93,7 +93,7 @@ const nextConfig = withBundleAnalyzer({
// 'sharp': 'commonjs sharp'
// },
swcMinify: true,
});
};
const CorsHeaders = [
{ key: "Access-Control-Allow-Credentials", value: "true" },