From f1ed9c7bd57ba5415b0a730d4b6d062cd7deb779 Mon Sep 17 00:00:00 2001 From: Fine Date: Mon, 12 Dec 2022 13:39:54 +0800 Subject: [PATCH] setup monacoEditorPlugin --- env.d.ts | 4 ++-- src/vite-env.d.ts | 7 +------ tsconfig.json | 5 +++++ vite.config.ts | 5 ++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/env.d.ts b/env.d.ts index c66343d5..2ed83e20 100644 --- a/env.d.ts +++ b/env.d.ts @@ -1,8 +1,8 @@ /// interface ImportMetaEnv { - readonly SW_PROXY_TARGET: string; - readonly drop_console: boolean; + readonly VITE_SW_PROXY_TARGET: string; + readonly VITE_DROP_CONSOLE: boolean; } interface ImportMeta { diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index d02be89e..75918071 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + /// declare module "*.vue" { import { defineComponent } from "vue"; @@ -28,9 +29,3 @@ declare global { axiosCancel: any; } } - -// declare module '*.vue' { -// import type { DefineComponent } from 'vue' -// const component: DefineComponent<{}, {}, any> -// export default component -// } diff --git a/tsconfig.json b/tsconfig.json index e0a6490f..43ad9edf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -28,6 +28,11 @@ "lib": ["ESNext", "DOM"], "skipLibCheck": true, "noEmit": true, + "paths": { + "@/*": [ + "./src/*" + ] + } }, "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], "references": [{ "path": "./tsconfig.node.json" }] diff --git a/vite.config.ts b/vite.config.ts index 3ef92531..088a5b8b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -22,8 +22,7 @@ import { loadEnv } from "vite"; import AutoImport from "unplugin-auto-import/vite"; import Components from "unplugin-vue-components/vite"; import { ElementPlusResolver } from "unplugin-vue-components/resolvers"; -// import monacoEditorPlugin from "vite-plugin-monaco-editor"; - +import monacoEditorPlugin from "vite-plugin-monaco-editor"; const OUTPUT_DIR = 'dist'; // https://vitejs.dev/config/ @@ -33,7 +32,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { return { plugins: [ vue(), - // monacoEditorPlugin(null), + monacoEditorPlugin({}), AutoImport({ imports: ["vue"], resolvers: [