全栈开发实战小草看书之Web端(三)配置文件
调试配置文件(.vscode/launch.json)
{
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
]
}
环境文件
开发环境(.env.development)
VITE_MGT_URL=http://localhost:8081
VITE_WEB_URL=http://localhost:8082
正式环境(.env.production)
VITE_MGT_URL=http://***.kskj.vip:8081
VITE_WEB_URL=http://***.kskj.vip:8082
Git忽略文件(.gitignore)
node_modules
.DS_Store
dist
dist-ssr
*.local
包文件(package.json)
{
"name": "lgw",
"version": "1.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"dependencies": {
"@element-plus/icons-vue": "^0.2.4",
"axios": "^0.24.0",
"element-plus": "^1.2.0-beta.6",
"screenfull": "^5.2.0",
"vue": "^3.2.16",
"vue-router": "^4.0.11",
"vuex": "^4.0.2",
"vuex-persistedstate": "^4.1.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^2.0.0",
"less": "^4.1.2",
"vite": "^2.7.1"
}
}
Vite配置文件(vite.config.js)
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
"~": resolve(__dirname, "./"),
"@": resolve(__dirname, "src"),
},
},
});
上一章 【全栈开发实战小草看书之Web端(二)创建项目】
下一章 【全栈开发实战小草看书之Web端(四)Vuex状态管理】