fix: add vite-plugin-live-reload

This commit is contained in:
xiaoxian521 2022-01-09 12:14:17 +08:00
parent 6a8c654936
commit c472772c54
3 changed files with 9 additions and 17 deletions

View File

@ -98,7 +98,7 @@
"typescript": "4.4.2",
"unplugin-element-plus": "^0.1.3",
"vite": "2.6.14",
"vite-plugin-full-reload": "^1.0.0",
"vite-plugin-live-reload": "^2.1.0",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-remove-console": "^0.0.6",
"vite-plugin-style-import": "^1.2.1",

20
pnpm-lock.yaml generated
View File

@ -65,7 +65,7 @@ specifiers:
typescript: 4.4.2
unplugin-element-plus: ^0.1.3
vite: 2.6.14
vite-plugin-full-reload: ^1.0.0
vite-plugin-live-reload: ^2.1.0
vite-plugin-mock: ^2.9.6
vite-plugin-remove-console: ^0.0.6
vite-plugin-style-import: ^1.2.1
@ -149,7 +149,7 @@ devDependencies:
typescript: 4.4.2
unplugin-element-plus: 0.1.3_vite@2.6.14+vue@3.2.24
vite: 2.6.14_sass@1.45.0
vite-plugin-full-reload: 1.0.0
vite-plugin-live-reload: 2.1.0
vite-plugin-mock: 2.9.6_mockjs@1.1.0+vite@2.6.14
vite-plugin-remove-console: 0.0.6
vite-plugin-style-import: 1.3.0_vite@2.6.14
@ -5253,14 +5253,6 @@ packages:
engines: { node: ">=8.6" }
dev: true
/picomatch/2.3.1:
resolution:
{
integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
}
engines: { node: ">=8.6" }
dev: true
/pify/2.3.0:
resolution: { integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw= }
engines: { node: ">=0.10.0" }
@ -7155,14 +7147,14 @@ packages:
vfile-message: 2.0.4
dev: true
/vite-plugin-full-reload/1.0.0:
/vite-plugin-live-reload/2.1.0:
resolution:
{
integrity: sha512-GUhQ4wSm+H6yAlz7d2JwLu+BEcsFqZu1SUH0CNG+uyP4ALXGofUjHi+eGdLX19bYhMuOUWW3EwMt68jFkBsMew==
integrity: sha512-NKIcVqrraPUZbsUKCKs+0StqKAmbAh2csbFxMWTXGDUeOoHAFni9H0CxtQelrYT5bQCV9FT/RveAM8q8bMdnQQ==
}
dependencies:
picocolors: 1.0.0
picomatch: 2.3.1
chalk: 4.1.2
chokidar: 3.5.2
dev: true
/vite-plugin-mock/2.9.6_mockjs@1.1.0+vite@2.6.14:

View File

@ -5,7 +5,7 @@ import legacy from "@vitejs/plugin-legacy";
import vueJsx from "@vitejs/plugin-vue-jsx";
import WindiCSS from "vite-plugin-windicss";
import { warpperEnv, regExps } from "./build";
import fullReload from "vite-plugin-full-reload";
import liveReload from "vite-plugin-live-reload";
import { viteMockServe } from "vite-plugin-mock";
import ElementPlus from "unplugin-element-plus/vite";
import removeConsole from "vite-plugin-remove-console";
@ -88,7 +88,7 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
// 线上环境删除console
removeConsole(),
// 修改layout文件夹下的文件时自动重载浏览器 解决 https://github.com/xiaoxian521/vue-pure-admin/issues/170
fullReload(["src/layout/**/*"]),
liveReload(["src/layout/**/*"]),
// 自定义主题
themePreprocessorPlugin({
scss: {