setup monacoEditorPlugin

This commit is contained in:
Fine 2022-12-12 13:39:54 +08:00
parent bc4517078a
commit f1ed9c7bd5
4 changed files with 10 additions and 11 deletions

4
env.d.ts vendored
View File

@ -1,8 +1,8 @@
/// <reference types="vite/client" /> /// <reference types="vite/client" />
interface ImportMetaEnv { interface ImportMetaEnv {
readonly SW_PROXY_TARGET: string; readonly VITE_SW_PROXY_TARGET: string;
readonly drop_console: boolean; readonly VITE_DROP_CONSOLE: boolean;
} }
interface ImportMeta { interface ImportMeta {

7
src/vite-env.d.ts vendored
View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/// <reference types="vite/client" /> /// <reference types="vite/client" />
declare module "*.vue" { declare module "*.vue" {
import { defineComponent } from "vue"; import { defineComponent } from "vue";
@ -28,9 +29,3 @@ declare global {
axiosCancel: any; axiosCancel: any;
} }
} }
// declare module '*.vue' {
// import type { DefineComponent } from 'vue'
// const component: DefineComponent<{}, {}, any>
// export default component
// }

View File

@ -28,6 +28,11 @@
"lib": ["ESNext", "DOM"], "lib": ["ESNext", "DOM"],
"skipLibCheck": true, "skipLibCheck": true,
"noEmit": true, "noEmit": true,
"paths": {
"@/*": [
"./src/*"
]
}
}, },
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }] "references": [{ "path": "./tsconfig.node.json" }]

View File

@ -22,8 +22,7 @@ import { loadEnv } from "vite";
import AutoImport from "unplugin-auto-import/vite"; import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite"; import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers"; 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'; const OUTPUT_DIR = 'dist';
// https://vitejs.dev/config/ // https://vitejs.dev/config/
@ -33,7 +32,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
return { return {
plugins: [ plugins: [
vue(), vue(),
// monacoEditorPlugin(null), monacoEditorPlugin({}),
AutoImport({ AutoImport({
imports: ["vue"], imports: ["vue"],
resolvers: [ resolvers: [