Files
DeepTutor/web/next.config.js
2025-12-28 23:45:41 +08:00

26 lines
603 B
JavaScript

/** @type {import('next').NextConfig} */
const path = require("path");
const nextConfig = {
// Handle ESM packages compatibility
experimental: {
esmExternals: "loose",
},
webpack: (config, { isServer }) => {
// Fix for mermaid's cytoscape dependency - use CJS version
config.resolve.alias = {
...config.resolve.alias,
cytoscape: path.resolve(
__dirname,
"node_modules/cytoscape/dist/cytoscape.cjs.js",
),
};
return config;
},
// Transpile mermaid and related packages
transpilePackages: ["mermaid"],
};
module.exports = nextConfig;