UPDATE:优化完善新增编辑检测计划绑定被检设备
This commit is contained in:
@@ -77,7 +77,7 @@
|
|||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vite-plugin-eslint": "^1.8.1",
|
"vite-plugin-eslint": "^1.8.1",
|
||||||
"vite-plugin-html": "^3.2.0",
|
"vite-plugin-html": "^3.2.0",
|
||||||
"vite-plugin-node-polyfills": "^0.23.0",
|
"vite-plugin-node-polyfills": "^0.24.0",
|
||||||
"vite-plugin-pwa": "^0.16.5",
|
"vite-plugin-pwa": "^0.16.5",
|
||||||
"vite-plugin-svg-icons": "^2.0.1",
|
"vite-plugin-svg-icons": "^2.0.1",
|
||||||
"vue-tsc": "^2.0.21"
|
"vue-tsc": "^2.0.21"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,110 +1,111 @@
|
|||||||
import { defineConfig, loadEnv, ConfigEnv, UserConfig } from "vite";
|
import { ConfigEnv, defineConfig, loadEnv, UserConfig } from 'vite'
|
||||||
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
||||||
import vue from "@vitejs/plugin-vue";
|
import vue from '@vitejs/plugin-vue'
|
||||||
import path from "path";
|
import path from 'path'
|
||||||
// 处理env环境参数读取
|
// 处理env环境参数读取
|
||||||
import { wrapperEnv } from "./build/getEnv";
|
import { wrapperEnv } from './build/getEnv'
|
||||||
import { createProxy } from "./build/proxy";
|
import { createProxy } from './build/proxy'
|
||||||
// 导入
|
// 导入
|
||||||
import vueJsx from "@vitejs/plugin-vue-jsx";
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||||
import AutoImport from "unplugin-auto-import/vite";
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import Components from "unplugin-vue-components/vite";
|
import Components from 'unplugin-vue-components/vite'
|
||||||
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
||||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
import { nodePolyfills } from 'vite-plugin-node-polyfills'
|
||||||
|
|
||||||
export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
|
export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
|
||||||
const root = process.cwd();
|
const root = process.cwd()
|
||||||
const env = loadEnv(mode, root);
|
const env = loadEnv(mode, root)
|
||||||
const viteEnv = wrapperEnv(env);
|
const viteEnv = wrapperEnv(env)
|
||||||
return {
|
return {
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
vueJsx(),
|
vueJsx(),
|
||||||
// svg图标配置,可以使用svg图标
|
// svg图标配置,可以使用svg图标
|
||||||
createSvgIconsPlugin({
|
createSvgIconsPlugin({
|
||||||
iconDirs: [path.resolve(process.cwd(), "src/assets/icons")],
|
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
|
||||||
symbolId: "icon-[dir]-[name]",
|
symbolId: 'icon-[dir]-[name]'
|
||||||
}),
|
}),
|
||||||
AutoImport({
|
AutoImport({
|
||||||
// 自动导入 Vue 相关函数,如:ref, reactive, toRef 等
|
// 自动导入 Vue 相关函数,如:ref, reactive, toRef 等
|
||||||
imports: ["vue", "@vueuse/core", "pinia", "vue-router", "vue-i18n"],
|
imports: ['vue', '@vueuse/core', 'pinia', 'vue-router', 'vue-i18n'],
|
||||||
resolvers: [
|
resolvers: [
|
||||||
// 自动导入 Element Plus 相关函数,如:ElMessage, ElMessageBox... (带样式)
|
// 自动导入 Element Plus 相关函数,如:ElMessage, ElMessageBox... (带样式)
|
||||||
ElementPlusResolver({
|
ElementPlusResolver({
|
||||||
importStyle: "sass",
|
importStyle: 'sass'
|
||||||
}),
|
})
|
||||||
|
],
|
||||||
|
eslintrc: {
|
||||||
|
// 是否自动生成 eslint 规则,建议生成之后设置 false
|
||||||
|
enabled: false,
|
||||||
|
// 指定自动导入函数 eslint 规则的文件
|
||||||
|
filepath: './.eslintrc-auto-import.json',
|
||||||
|
globalsPropValue: true
|
||||||
|
},
|
||||||
|
// 是否在 vue 模板中自动导入
|
||||||
|
vueTemplate: true,
|
||||||
|
// 指定自动导入函数TS类型声明文件路径 (false:关闭自动生成)
|
||||||
|
dts: false
|
||||||
|
// dts: "src/types/auto-imports.d.ts",
|
||||||
|
}),
|
||||||
|
Components({
|
||||||
|
resolvers: [
|
||||||
|
// 自动导入 Element Plus 组件
|
||||||
|
ElementPlusResolver({
|
||||||
|
importStyle: 'sass'
|
||||||
|
})
|
||||||
|
],
|
||||||
|
// 指定自定义组件位置(默认:src/components)
|
||||||
|
dirs: ['src/components', 'src/**/components'],
|
||||||
|
// 指定自动导入组件TS类型声明文件路径 (false:关闭自动生成)
|
||||||
|
dts: false
|
||||||
|
// dts: "src/types/components.d.ts",
|
||||||
|
}),
|
||||||
|
nodePolyfills({
|
||||||
|
include: ['crypto'],
|
||||||
|
globals: {
|
||||||
|
crypto: true
|
||||||
|
}
|
||||||
|
})
|
||||||
],
|
],
|
||||||
eslintrc: {
|
// 基础配置
|
||||||
// 是否自动生成 eslint 规则,建议生成之后设置 false
|
base: viteEnv.VITE_PUBLIC_PATH,
|
||||||
enabled: false,
|
root,
|
||||||
// 指定自动导入函数 eslint 规则的文件
|
publicDir: 'public',
|
||||||
filepath: "./.eslintrc-auto-import.json",
|
resolve: {
|
||||||
globalsPropValue: true,
|
alias: {
|
||||||
|
'@': path.resolve(__dirname, 'src'),
|
||||||
|
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 是否在 vue 模板中自动导入
|
css: {
|
||||||
vueTemplate: true,
|
preprocessorOptions: {
|
||||||
// 指定自动导入函数TS类型声明文件路径 (false:关闭自动生成)
|
scss: {
|
||||||
dts: false,
|
prependData: `@import "@/styles/var.scss";`,
|
||||||
// dts: "src/types/auto-imports.d.ts",
|
api: 'modern-compiler'
|
||||||
}),
|
}
|
||||||
Components({
|
}
|
||||||
resolvers: [
|
|
||||||
// 自动导入 Element Plus 组件
|
|
||||||
ElementPlusResolver({
|
|
||||||
importStyle: "sass",
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
// 指定自定义组件位置(默认:src/components)
|
|
||||||
dirs: ["src/components", "src/**/components"],
|
|
||||||
// 指定自动导入组件TS类型声明文件路径 (false:关闭自动生成)
|
|
||||||
dts: false,
|
|
||||||
// dts: "src/types/components.d.ts",
|
|
||||||
}),
|
|
||||||
nodePolyfills({
|
|
||||||
include: ['crypto'],
|
|
||||||
globals: {
|
|
||||||
crypto: true,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
// 基础配置
|
|
||||||
base: viteEnv.VITE_PUBLIC_PATH,
|
|
||||||
root,
|
|
||||||
publicDir: "public",
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
"@": path.resolve(__dirname, "src"),
|
|
||||||
"vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
css: {
|
|
||||||
preprocessorOptions: {
|
|
||||||
scss: {
|
|
||||||
prependData: `@import "@/styles/var.scss";`,
|
|
||||||
},
|
},
|
||||||
},
|
build: {
|
||||||
},
|
outDir: 'dist',
|
||||||
build: {
|
assetsDir: 'assets',
|
||||||
outDir: "dist",
|
assetsInlineLimit: 4096,
|
||||||
assetsDir: "assets",
|
cssCodeSplit: true,
|
||||||
assetsInlineLimit: 4096,
|
sourcemap: false,
|
||||||
cssCodeSplit: true,
|
minify: 'terser',
|
||||||
sourcemap: false,
|
terserOptions: {
|
||||||
minify: "terser",
|
compress: {
|
||||||
terserOptions: {
|
// 生产环境去除console及debug
|
||||||
compress: {
|
drop_console: false,
|
||||||
// 生产环境去除console及debug
|
drop_debugger: true
|
||||||
drop_console: false,
|
}
|
||||||
drop_debugger: true,
|
}
|
||||||
},
|
},
|
||||||
},
|
server: {
|
||||||
},
|
host: '0.0.0.0',
|
||||||
server: {
|
port: viteEnv.VITE_PORT,
|
||||||
host: "0.0.0.0",
|
open: viteEnv.VITE_OPEN,
|
||||||
port: viteEnv.VITE_PORT,
|
cors: true,
|
||||||
open: viteEnv.VITE_OPEN,
|
proxy: createProxy(viteEnv.VITE_PROXY)
|
||||||
cors: true,
|
}
|
||||||
proxy: createProxy(viteEnv.VITE_PROXY),
|
}
|
||||||
},
|
})
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|||||||
Reference in New Issue
Block a user