@@ -12,19 +12,6 @@ import tsconfigPaths from "vite-tsconfig-paths";
1212// from our electron build
1313const CHROME = "chrome140" ;
1414const NODE = "node22" ;
15- const MERMAID_CORE = path . resolve ( __dirname , "node_modules/mermaid/dist/mermaid.core.mjs" ) ;
16-
17- function streamdownMermaidFix ( ) {
18- return {
19- name : "streamdown-mermaid-fix" ,
20- enforce : "pre" as const ,
21- transform ( code : string , id : string ) {
22- if ( ! id . includes ( "node_modules/streamdown" ) ) return null ;
23- if ( ! code . includes ( "import('mermaid')" ) ) return null ;
24- return code . replaceAll ( "import('mermaid')" , `import('/@fs${ MERMAID_CORE } ')` ) ;
25- } ,
26- } ;
27- }
2815
2916export default defineConfig ( {
3017 main : {
@@ -43,7 +30,6 @@ export default defineConfig({
4330 resolve : {
4431 alias : {
4532 "@" : "frontend" ,
46- mermaid : path . resolve ( __dirname , "node_modules/mermaid/dist/mermaid.js" ) ,
4733 } ,
4834 } ,
4935 server : {
@@ -148,7 +134,6 @@ export default defineConfig({
148134 } ,
149135 plugins : [
150136 tsconfigPaths ( ) ,
151- streamdownMermaidFix ( ) ,
152137 { ...ViteImageOptimizer ( ) , apply : "build" } ,
153138 svgr ( {
154139 svgrOptions : { exportType : "default" , ref : true , svgo : false , titleProp : true } ,
0 commit comments