forked from integrated_whb/integrated_whb_vue
环境变量
parent
f77aa17083
commit
f2e8d02867
|
@ -2,4 +2,4 @@ public
|
|||
dist
|
||||
package.json
|
||||
!.prettierrc.cjs
|
||||
src/vite-env.d.ts
|
||||
env.d.ts
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
interface ImportMetaEnv {
|
||||
// Auto generate by env-parse
|
||||
/**
|
||||
* undefined
|
||||
*/
|
||||
readonly VITE_BASE_URL: string
|
||||
/**
|
||||
* undefined
|
||||
*/
|
||||
readonly VITE_PROXY: Record<string, any>
|
||||
/**
|
||||
* undefined
|
||||
*/
|
||||
readonly VITE_FILE_URL: string
|
||||
/**
|
||||
* undefined
|
||||
*/
|
||||
readonly VITE_TEMPLATE_URL: string
|
||||
/**
|
||||
* undefined
|
||||
*/
|
||||
readonly VITE_ON_LINE_WEB_SOCKET_URL: string
|
||||
/**
|
||||
* undefined
|
||||
*/
|
||||
readonly VITE_LEARNING_WEB_SOCKET_URL: string
|
||||
}
|
|
@ -68,6 +68,7 @@
|
|||
"unplugin-vue-components": "^0.22.12",
|
||||
"vite": "^4.5.1",
|
||||
"vite-plugin-enhance-log": "^0.5.2",
|
||||
"vite-plugin-env-parse": "^1.0.10",
|
||||
"vite-plugin-eslint": "^1.8.1",
|
||||
"vite-plugin-remove-console": "^2.2.0",
|
||||
"vue-eslint-parser": "^9.3.2"
|
||||
|
@ -5966,6 +5967,15 @@
|
|||
"vite": "^2.9.0 || ^3.0.0 || ^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vite-plugin-env-parse": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmmirror.com/vite-plugin-env-parse/-/vite-plugin-env-parse-1.0.10.tgz",
|
||||
"integrity": "sha512-7C3ixNz02ExrYCZRkAhXRWXqWktR/YO/SkrCdOUFR3GCXALUGt4xNhTTVZonKH8SpA4xe1wp2mS606MKZdvOpw==",
|
||||
"dev": true,
|
||||
"peerDependencies": {
|
||||
"vite": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/vite-plugin-eslint": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmmirror.com/vite-plugin-eslint/-/vite-plugin-eslint-1.8.1.tgz",
|
||||
|
|
|
@ -70,6 +70,7 @@
|
|||
"unplugin-vue-components": "^0.22.12",
|
||||
"vite": "^4.5.1",
|
||||
"vite-plugin-enhance-log": "^0.5.2",
|
||||
"vite-plugin-env-parse": "^1.0.10",
|
||||
"vite-plugin-eslint": "^1.8.1",
|
||||
"vite-plugin-remove-console": "^2.2.0",
|
||||
"vue-eslint-parser": "^9.3.2"
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_BASE_URL: string
|
||||
readonly VITE_PROXY: string
|
||||
readonly VITE_FILE_URL: string
|
||||
readonly VITE_TEMPLATE_URL: string
|
||||
readonly VITE_ON_LINE_WEB_SOCKET_URL: string
|
||||
readonly VITE_LEARNING_WEB_SOCKET_URL: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv
|
||||
}
|
|
@ -10,11 +10,13 @@ import {
|
|||
// import basicSsl from "@vitejs/plugin-basic-ssl";
|
||||
import removeConsole from "vite-plugin-remove-console";
|
||||
import EnhanceLog from "vite-plugin-enhance-log";
|
||||
import { envParse } from "vite-plugin-env-parse";
|
||||
|
||||
export default ({ mode }) => {
|
||||
return defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
envParse(),
|
||||
eslintPlugin(),
|
||||
removeConsole({
|
||||
includes: [
|
||||
|
|
Loading…
Reference in New Issue