mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-03 14:31:05 +08:00
26 lines
603 B
JavaScript
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;
|