123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- import { defineConfig, loadEnv } from "file:///D:/xy/vue/smo/node_modules/.pnpm/vite@5.3.2_@types+node@20.5.7_sass@1.77.6_terser@5.19.2/node_modules/vite/dist/node/index.js";
- import { resolve as resolve2 } from "path";
- function wrapperEnv(envConf) {
- const ret = {};
- for (const envName of Object.keys(envConf)) {
- let realName = envConf[envName].replace(/\\n/g, "\n");
- realName = realName === "true" ? true : realName === "false" ? false : realName;
- if (envName === "VITE_PORT") realName = Number(realName);
- if (envName === "VITE_PROXY") {
- try {
- realName = JSON.parse(realName);
- } catch (error) {
- }
- }
- ret[envName] = realName;
- }
- return ret;
- }
- function createProxy(list = []) {
- const ret = {};
- for (const [prefix, target] of list) {
- const httpsRE = /^https:\/\//;
- const isHttps = httpsRE.test(target);
- ret[prefix] = {
- target,
- changeOrigin: true,
- ws: true,
- rewrite: (path) => path.replace(new RegExp(`^${prefix}`), ""),
-
- ...isHttps ? { secure: false } : {}
- };
- }
- return ret;
- }
- import { resolve } from "path";
- import { VitePWA } from "file:///D:/xy/vue/smo/node_modules/.pnpm/vite-plugin-pwa@0.20.0_vite@5.3.2_@types+node@20.5.7_sass@1.77.6_terser@5.19.2__workbox-build@7.1.0_workbox-window@7.1.0/node_modules/vite-plugin-pwa/dist/index.js";
- import { createHtmlPlugin } from "file:///D:/xy/vue/smo/node_modules/.pnpm/vite-plugin-html@3.2.2_vite@5.3.2_@types+node@20.5.7_sass@1.77.6_terser@5.19.2_/node_modules/vite-plugin-html/dist/index.mjs";
- import { visualizer } from "file:///D:/xy/vue/smo/node_modules/.pnpm/rollup-plugin-visualizer@5.12.0_rollup@2.79.1/node_modules/rollup-plugin-visualizer/dist/plugin/index.js";
- import { createSvgIconsPlugin } from "file:///D:/xy/vue/smo/node_modules/.pnpm/vite-plugin-svg-icons@2.0.1_vite@5.3.2_@types+node@20.5.7_sass@1.77.6_terser@5.19.2_/node_modules/vite-plugin-svg-icons/dist/index.mjs";
- import vue from "file:///D:/xy/vue/smo/node_modules/.pnpm/@vitejs+plugin-vue@5.0.4_vite@5.3.2_@types+node@20.5.7_sass@1.77.6_terser@5.19.2__vue@3.4.31_typescript@5.5.2_/node_modules/@vitejs/plugin-vue/dist/index.mjs";
- import vueJsx from "file:///D:/xy/vue/smo/node_modules/.pnpm/@vitejs+plugin-vue-jsx@3.1.0_vite@5.3.2_@types+node@20.5.7_sass@1.77.6_terser@5.19.2__vue@3.4.31_typescript@5.5.2_/node_modules/@vitejs/plugin-vue-jsx/dist/index.mjs";
- import eslintPlugin from "file:///D:/xy/vue/smo/node_modules/.pnpm/vite-plugin-eslint@1.8.1_eslint@8.57.0_vite@5.3.2_@types+node@20.5.7_sass@1.77.6_terser@5.19.2_/node_modules/vite-plugin-eslint/dist/index.mjs";
- import viteCompression from "file:///D:/xy/vue/smo/node_modules/.pnpm/vite-plugin-compression@0.5.1_vite@5.3.2_@types+node@20.5.7_sass@1.77.6_terser@5.19.2_/node_modules/vite-plugin-compression/dist/index.mjs";
- import vueSetupExtend from "file:///D:/xy/vue/smo/node_modules/.pnpm/unplugin-vue-setup-extend-plus@1.0.1/node_modules/unplugin-vue-setup-extend-plus/dist/vite.js";
- import NextDevTools from "file:///D:/xy/vue/smo/node_modules/.pnpm/vite-plugin-vue-devtools@7.3.5_rollup@2.79.1_vite@5.3.2_@types+node@20.5.7_sass@1.77.6_terser_zsowrurn4w5teqrzb4fba3ssvi/node_modules/vite-plugin-vue-devtools/dist/vite.mjs";
- var createVitePlugins = (viteEnv) => {
- const { VITE_GLOB_APP_TITLE, VITE_REPORT, VITE_DEVTOOLS, VITE_PWA } = viteEnv;
- return [
- vue(),
-
- vueJsx(),
-
- VITE_DEVTOOLS && NextDevTools({ launchEditor: "code" }),
-
- eslintPlugin(),
-
- vueSetupExtend({}),
-
- createCompression(viteEnv),
-
- createHtmlPlugin({
- minify: true,
- inject: {
- data: { title: VITE_GLOB_APP_TITLE }
- }
- }),
-
- createSvgIconsPlugin({
- iconDirs: [resolve(process.cwd(), "src/assets/icons")],
- symbolId: "icon-[dir]-[name]"
- }),
-
- VITE_PWA && createVitePwa(viteEnv),
-
- VITE_REPORT && visualizer({ filename: "stats.html", gzipSize: true, brotliSize: true })
- ];
- };
- var createCompression = (viteEnv) => {
- const { VITE_BUILD_COMPRESS = "none", VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE } = viteEnv;
- const compressList = VITE_BUILD_COMPRESS.split(",");
- const plugins = [];
- if (compressList.includes("gzip")) {
- plugins.push(
- viteCompression({
- ext: ".gz",
- algorithm: "gzip",
- deleteOriginFile: VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE
- })
- );
- }
- if (compressList.includes("brotli")) {
- plugins.push(
- viteCompression({
- ext: ".br",
- algorithm: "brotliCompress",
- deleteOriginFile: VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE
- })
- );
- }
- return plugins;
- };
- var createVitePwa = (viteEnv) => {
- const { VITE_GLOB_APP_TITLE } = viteEnv;
- return VitePWA({
- registerType: "autoUpdate",
- manifest: {
- name: VITE_GLOB_APP_TITLE,
- short_name: VITE_GLOB_APP_TITLE,
- theme_color: "#ffffff",
- icons: [
- {
- src: "/logo.png",
- sizes: "192x192",
- type: "image/png"
- },
- {
- src: "/logo.png",
- sizes: "512x512",
- type: "image/png"
- },
- {
- src: "/logo.png",
- sizes: "512x512",
- type: "image/png",
- purpose: "any maskable"
- }
- ]
- }
- });
- };
- var package_default = {
- name: "admin",
- private: true,
- version: "1.2.0",
- type: "module",
- description: "admin open source management system",
- scripts: {
- dev: "vite",
- serve: "vite",
- "build:dev": "vite build --mode development",
- "build:test": "vite build --mode test",
- "build:pro": "vite build --mode production",
- "type:check": "vue-tsc --noEmit --skipLibCheck",
- preview: "pnpm build:dev && vite preview",
- "lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src",
- "lint:prettier": 'prettier --write "src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}"',
- "lint:stylelint": 'stylelint --cache --fix "**/*.{vue,less,postcss,css,scss}" --cache --cache-location node_modules/.cache/stylelint/',
- "lint:lint-staged": "lint-staged",
- prepare: "husky install",
- release: "standard-version",
- commit: "git add -A && czg && git push"
- },
- dependencies: {
- "@element-plus/icons-vue": "^2.3.1",
- "@vueuse/core": "^10.11.0",
- "@wangeditor/editor": "^5.1.23",
- "@wangeditor/editor-for-vue": "^5.1.12",
- axios: "^1.7.2",
- dayjs: "^1.11.11",
- "driver.js": "^1.3.1",
- echarts: "^5.5.1",
- "echarts-liquidfill": "^3.1.0",
- "element-plus": "^2.7.6",
- md5: "^2.3.0",
- mitt: "^3.0.1",
- nprogress: "^0.2.0",
- ol: "^10.2.1",
- pinia: "^2.1.7",
- "pinia-plugin-persistedstate": "^3.2.1",
- qs: "^6.12.1",
- screenfull: "^6.0.2",
- sortablejs: "^1.15.2",
- vue: "^3.4.31",
- "vue-i18n": "^9.13.1",
- "vue-pdf-embed": "^2.1.0",
- "vue-router": "^4.4.0",
- "vue3-pdfjs": "^0.1.6",
- vuedraggable: "^4.1.0"
- },
- devDependencies: {
- "@commitlint/cli": "^18.4.3",
- "@commitlint/config-conventional": "^18.4.3",
- "@types/md5": "^2.3.5",
- "@types/nprogress": "^0.2.3",
- "@types/qs": "^6.9.15",
- "@types/sortablejs": "^1.15.8",
- "@typescript-eslint/eslint-plugin": "^7.14.1",
- "@typescript-eslint/parser": "^7.14.1",
- "@vitejs/plugin-vue": "^5.0.4",
- "@vitejs/plugin-vue-jsx": "^3.1.0",
- autoprefixer: "^10.4.19",
- "cz-git": "1.9.2",
- czg: "^1.9.2",
- eslint: "^8.57.0",
- "eslint-config-prettier": "^9.1.0",
- "eslint-plugin-prettier": "^5.1.3",
- "eslint-plugin-vue": "^9.26.0",
- husky: "^9.0.11",
- "lint-staged": "^15.2.5",
- postcss: "^8.4.38",
- "postcss-html": "^1.7.0",
- prettier: "^3.3.2",
- "rollup-plugin-visualizer": "^5.12.0",
- sass: "^1.77.6",
- "standard-version": "^9.5.0",
- stylelint: "^16.6.1",
- "stylelint-config-html": "^1.1.0",
- "stylelint-config-recess-order": "^5.0.1",
- "stylelint-config-recommended-scss": "^14.0.0",
- "stylelint-config-recommended-vue": "^1.5.0",
- "stylelint-config-standard": "^36.0.0",
- "stylelint-config-standard-scss": "^13.1.0",
- typescript: "^5.5.2",
- "unplugin-vue-setup-extend-plus": "^1.0.1",
- vite: "^5.3.2",
- "vite-plugin-compression": "^0.5.1",
- "vite-plugin-eslint": "^1.8.1",
- "vite-plugin-html": "^3.2.2",
- "vite-plugin-pwa": "^0.20.0",
- "vite-plugin-svg-icons": "^2.0.1",
- "vite-plugin-vue-devtools": "^7.3.5",
- "vue-tsc": "^2.0.22"
- },
- engines: {
- node: ">=16.18.0"
- },
- browserslist: {
- production: [
- "> 1%",
- "not dead",
- "not op_mini all"
- ],
- development: [
- "last 1 chrome version",
- "last 1 firefox version",
- "last 1 safari version"
- ]
- },
- config: {
- commitizen: {
- path: "node_modules/cz-git"
- }
- }
- };
- import dayjs from "file:///D:/xy/vue/smo/node_modules/.pnpm/dayjs@1.11.11/node_modules/dayjs/dayjs.min.js";
- var __vite_injected_original_dirname = "D:\\xy\\vue\\smo";
- var { dependencies, devDependencies, name, version } = package_default;
- var __APP_INFO__ = {
- pkg: { dependencies, devDependencies, name, version },
- lastBuildTime: dayjs().format("YYYY-MM-DD HH:mm:ss")
- };
- var vite_config_default = defineConfig(({ mode }) => {
- const root = process.cwd();
- const env = loadEnv(mode, root);
- const viteEnv = wrapperEnv(env);
- return {
- base: viteEnv.VITE_PUBLIC_PATH,
- root,
- resolve: {
- alias: {
- "@": resolve2(__vite_injected_original_dirname, "./src"),
- "vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js"
- }
- },
- define: {
- __APP_INFO__: JSON.stringify(__APP_INFO__)
- },
- css: {
- preprocessorOptions: {
- scss: {
- additionalData: `@import "@/styles/var.scss";`
- }
- }
- },
- server: {
- host: "0.0.0.0",
- port: viteEnv.VITE_PORT,
- open: viteEnv.VITE_OPEN,
- cors: true,
-
- proxy: createProxy(viteEnv.VITE_PROXY)
- },
- plugins: createVitePlugins(viteEnv),
- esbuild: {
- pure: viteEnv.VITE_DROP_CONSOLE ? ["console.log", "debugger"] : []
- },
- build: {
- outDir: "dist",
- minify: "esbuild",
-
-
-
-
-
-
-
-
- sourcemap: false,
-
- reportCompressedSize: false,
-
- chunkSizeWarningLimit: 2e3,
- rollupOptions: {
- output: {
-
- chunkFileNames: "assets/js/[name]-[hash].js",
- entryFileNames: "assets/js/[name]-[hash].js",
- assetFileNames: "assets/[ext]/[name]-[hash].[ext]"
- }
- }
- }
- };
- });
- export {
- vite_config_default as default
- };
|