|
@@ -1,7 +1,7 @@
|
|
|
-import {defineConfig} from 'vite'
|
|
|
+import { defineConfig } from 'vite'
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
-import {resolve} from "path";
|
|
|
-import config from "./src/config";
|
|
|
+import { resolve } from 'path'
|
|
|
+import config from './src/config'
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
export default defineConfig({
|
|
@@ -9,9 +9,9 @@ export default defineConfig({
|
|
|
extract: true,
|
|
|
preprocessorOptions: {
|
|
|
scss: {
|
|
|
- additionalData: `@import "./src/styles/app/_var.scss";`
|
|
|
- }
|
|
|
- }
|
|
|
+ additionalData: '@import "./src/styles/app/_var.scss";',
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
resolve: {
|
|
|
alias: {
|
|
@@ -20,8 +20,8 @@ export default defineConfig({
|
|
|
'~com': `${resolve(__dirname, './src/components')}`,
|
|
|
'~api': resolve(__dirname, './src/api/modules'),
|
|
|
'~sto': resolve(__dirname, './src/store/modules'),
|
|
|
- '~uti': resolve(__dirname, './src/utils')
|
|
|
- }
|
|
|
+ '~uti': resolve(__dirname, './src/utils'),
|
|
|
+ },
|
|
|
},
|
|
|
plugins: [
|
|
|
vue(),
|
|
@@ -30,7 +30,7 @@ export default defineConfig({
|
|
|
rollupOptions: {
|
|
|
output: {
|
|
|
manualChunks(id) {
|
|
|
- let libStr = '@vue,tailwindcss,element-plus,z-element-plus,echarts,vue-router,pinia,js-fast-way';
|
|
|
+ let libStr = '@vue,tailwindcss,element-plus,z-element-plus,echarts,vue-router,pinia,js-fast-way'
|
|
|
const libs = libStr.split(',')
|
|
|
if (id.includes('node_modules')) {
|
|
|
const arr = id.toString().split('node_modules/')[1].split('/')
|
|
@@ -43,12 +43,12 @@ export default defineConfig({
|
|
|
},
|
|
|
chunkFileNames: 'static/js1/[name]-[hash].js',
|
|
|
entryFileNames: 'static/js2/[name]-[hash].js',
|
|
|
- assetFileNames: 'static/[ext]/[name]-[hash].[ext]'
|
|
|
+ assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
|
|
|
},
|
|
|
brotliSize: false, // 不统计
|
|
|
target: 'esnext',
|
|
|
- minify: 'esbuild' // 混淆器,terser构建后文件体积更小
|
|
|
- }
|
|
|
+ minify: 'esbuild', // 混淆器,terser构建后文件体积更小
|
|
|
+ },
|
|
|
},
|
|
|
server: {
|
|
|
...config.vite,
|
|
@@ -58,7 +58,7 @@ export default defineConfig({
|
|
|
changeOrigin: true,
|
|
|
target: config.target,
|
|
|
rewrite: (path) => path.replace(new RegExp('^/api'), '/'),
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
})
|