Browse Source

fix: add vite-plugin-live-reload

i18n
xiaoxian521 3 years ago
parent
commit
c472772c54
  1. 2
      package.json
  2. 20
      pnpm-lock.yaml
  3. 4
      vite.config.ts

2
package.json

@ -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

@ -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:

4
vite.config.ts

@ -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: {

Loading…
Cancel
Save