chore: update VITE_PORT

This commit is contained in:
xiaoxian521 2021-08-31 11:50:39 +08:00
parent e85f36b76e
commit b458a942c9
3 changed files with 25 additions and 19 deletions

6
.env
View File

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

View File

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

View File

@ -1,30 +1,30 @@
import { resolve } from "path" import { resolve } from "path";
import { UserConfigExport, ConfigEnv } from "vite" import { UserConfigExport, ConfigEnv } from "vite";
import vue from "@vitejs/plugin-vue" import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx" import vueJsx from "@vitejs/plugin-vue-jsx";
import { loadEnv } from "./build/utils" import { loadEnv } from "./build/utils";
import { createProxy } from "./build/proxy" import { createProxy } from "./build/proxy";
import { viteMockServe } from "vite-plugin-mock" import { viteMockServe } from "vite-plugin-mock";
import svgLoader from "vite-svg-loader" import svgLoader from "vite-svg-loader";
import styleImport from "vite-plugin-style-import" import styleImport from "vite-plugin-style-import";
import VitePluginElementPlus from "vite-plugin-element-plus" import VitePluginElementPlus from "vite-plugin-element-plus";
const pathResolve = (dir: string): any => { 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> = { const alias: Record<string, string> = {
"/@": pathResolve("src"), "/@": 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. //解决开发环境下的警告 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" "vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js"
} };
const root: string = process.cwd() const root: string = process.cwd();
export default ({ command }: ConfigEnv): UserConfigExport => { export default ({ command }: ConfigEnv): UserConfigExport => {
const prodMock = true const prodMock = true;
return { return {
/** /**
* *
@ -95,5 +95,5 @@ export default ({ command }: ConfigEnv): UserConfigExport => {
define: { define: {
__INTLIFY_PROD_DEVTOOLS__: false __INTLIFY_PROD_DEVTOOLS__: false
} }
} };
} };