Browse Source

chore: update VITE_PORT

xiaoxian521 3 years ago
parent
commit
b458a942c9
3 changed files with 25 additions and 19 deletions
  1. 6 0
      .env
  2. 1 1
      .env.development
  3. 18 18
      vite.config.ts

+ 6 - 0
.env

@@ -1,3 +1,9 @@
+# port
+VITE_PORT = 8848
+
+# open
+VITE_OPEN = false
+
 # public path
 VITE_PUBLIC_PATH = /
 

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
 # port
-VITE_PORT = 3001
+VITE_PORT = 8848
 
 # open
 VITE_OPEN = false

+ 18 - 18
vite.config.ts

@@ -1,30 +1,30 @@
-import { resolve } from "path"
-import { UserConfigExport, ConfigEnv } from "vite"
-import vue from "@vitejs/plugin-vue"
-import vueJsx from "@vitejs/plugin-vue-jsx"
-import { loadEnv } from "./build/utils"
-import { createProxy } from "./build/proxy"
-import { viteMockServe } from "vite-plugin-mock"
-import svgLoader from "vite-svg-loader"
-import styleImport from "vite-plugin-style-import"
-import VitePluginElementPlus from "vite-plugin-element-plus"
+import { resolve } from "path";
+import { UserConfigExport, ConfigEnv } from "vite";
+import vue from "@vitejs/plugin-vue";
+import vueJsx from "@vitejs/plugin-vue-jsx";
+import { loadEnv } from "./build/utils";
+import { createProxy } from "./build/proxy";
+import { viteMockServe } from "vite-plugin-mock";
+import svgLoader from "vite-svg-loader";
+import styleImport from "vite-plugin-style-import";
+import VitePluginElementPlus from "vite-plugin-element-plus";
 
 const pathResolve = (dir: string): any => {
-  return resolve(__dirname, ".", dir)
-}
+  return resolve(__dirname, ".", dir);
+};
 
-const { VITE_PORT, VITE_PUBLIC_PATH, VITE_PROXY } = loadEnv()
+const { VITE_PORT, VITE_PUBLIC_PATH, VITE_PROXY } = loadEnv();
 
 const alias: Record<string, string> = {
   "/@": pathResolve("src"),
   //解决开发环境下的警告 You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.
   "vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js"
-}
+};
 
-const root: string = process.cwd()
+const root: string = process.cwd();
 
 export default ({ command }: ConfigEnv): UserConfigExport => {
-  const prodMock = true
+  const prodMock = true;
   return {
     /**
      * 基本公共路径
@@ -95,5 +95,5 @@ export default ({ command }: ConfigEnv): UserConfigExport => {
     define: {
       __INTLIFY_PROD_DEVTOOLS__: false
     }
-  }
-}
+  };
+};