代码优化
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
"build": "next build",
|
"build": "next build",
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
"tauri": "tauri",
|
"tauri": "tauri",
|
||||||
"postinstall": "cp -r node_modules/monaco-editor/min/vs public/vs"
|
"postinstall": "node -e \"const fs=require('fs');fs.cpSync('node_modules/monaco-editor/min/vs','public/vs',{recursive:true,force:true})\""
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@base-ui/react": "^1.1.0",
|
"@base-ui/react": "^1.1.0",
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { useTranslations } from "next-intl"
|
|||||||
import { useFolderContext } from "@/contexts/folder-context"
|
import { useFolderContext } from "@/contexts/folder-context"
|
||||||
import { defineMonacoThemes, useMonacoThemeSync } from "@/lib/monaco-themes"
|
import { defineMonacoThemes, useMonacoThemeSync } from "@/lib/monaco-themes"
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
|
import "@/lib/monaco-local"
|
||||||
|
|
||||||
type RowMarker = "none" | "added" | "deleted" | "modified"
|
type RowMarker = "none" | "added" | "deleted" | "modified"
|
||||||
type DiffFileMode = "modified" | "added" | "deleted" | "renamed"
|
type DiffFileMode = "modified" | "added" | "deleted" | "renamed"
|
||||||
@@ -71,8 +72,6 @@ interface HunkPreviewLine {
|
|||||||
marker: RowMarker
|
marker: RowMarker
|
||||||
}
|
}
|
||||||
|
|
||||||
import "@/lib/monaco-local"
|
|
||||||
|
|
||||||
const MonacoEditor = dynamic(async () => import("@monaco-editor/react"), {
|
const MonacoEditor = dynamic(async () => import("@monaco-editor/react"), {
|
||||||
ssr: false,
|
ssr: false,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
ContextMenuTrigger,
|
ContextMenuTrigger,
|
||||||
} from "@/components/ui/context-menu"
|
} from "@/components/ui/context-menu"
|
||||||
import { defineMonacoThemes, useMonacoThemeSync } from "@/lib/monaco-themes"
|
import { defineMonacoThemes, useMonacoThemeSync } from "@/lib/monaco-themes"
|
||||||
|
import "@/lib/monaco-local"
|
||||||
|
|
||||||
const AUTO_SAVE_DELAY_MS = 5000
|
const AUTO_SAVE_DELAY_MS = 5000
|
||||||
|
|
||||||
@@ -291,8 +292,6 @@ function setEditorHiddenAreas(
|
|||||||
hiddenAreaEditor.setHiddenAreas?.(ranges)
|
hiddenAreaEditor.setHiddenAreas?.(ranges)
|
||||||
}
|
}
|
||||||
|
|
||||||
import "@/lib/monaco-local"
|
|
||||||
|
|
||||||
const MonacoEditor = dynamic(async () => import("@monaco-editor/react"), {
|
const MonacoEditor = dynamic(async () => import("@monaco-editor/react"), {
|
||||||
ssr: false,
|
ssr: false,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user