mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-11 00:23:08 +08:00
fix: 移动打包配置位置
This commit is contained in:
parent
a63efa5d26
commit
b691003187
@ -1 +1,25 @@
|
|||||||
export const OUTPUT_DIR = 'dist';
|
export const OUTPUT_DIR = 'dist';
|
||||||
|
|
||||||
|
// chunk 警告大小
|
||||||
|
export const chunkSizeWarningLimit = 2000
|
||||||
|
|
||||||
|
// 禁用 brotli 压缩大小报告
|
||||||
|
export const brotliSize = false
|
||||||
|
|
||||||
|
// 分包
|
||||||
|
export const rollupOptions = {
|
||||||
|
output: {
|
||||||
|
chunkFileNames: 'static/js/[name]-[hash].js',
|
||||||
|
entryFileNames: 'static/js/[name]-[hash].js',
|
||||||
|
assetFileNames: 'static/[ext]/[name]-[hash].[ext]'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 去除开发代码
|
||||||
|
export const terserOptions = {
|
||||||
|
compress: {
|
||||||
|
keep_infinity: true,
|
||||||
|
drop_console: true,
|
||||||
|
drop_debugger: true
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
import { OUTPUT_DIR } from './build/constant'
|
import { OUTPUT_DIR, brotliSize, chunkSizeWarningLimit, terserOptions, rollupOptions } from './build/constant'
|
||||||
import viteCompression from 'vite-plugin-compression'
|
import viteCompression from 'vite-plugin-compression'
|
||||||
|
|
||||||
function pathResolve(dir: string) {
|
function pathResolve(dir: string) {
|
||||||
@ -44,21 +44,9 @@ export default defineConfig({
|
|||||||
build: {
|
build: {
|
||||||
target: 'es2015',
|
target: 'es2015',
|
||||||
outDir: OUTPUT_DIR,
|
outDir: OUTPUT_DIR,
|
||||||
terserOptions: {
|
terserOptions: terserOptions,
|
||||||
compress: {
|
rollupOptions: rollupOptions,
|
||||||
keep_infinity: true,
|
brotliSize: brotliSize,
|
||||||
drop_console: true,
|
chunkSizeWarningLimit: chunkSizeWarningLimit
|
||||||
drop_debugger: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rollupOptions: {
|
|
||||||
output: {
|
|
||||||
chunkFileNames: 'static/js/[name]-[hash].js',
|
|
||||||
entryFileNames: 'static/js/[name]-[hash].js',
|
|
||||||
assetFileNames: 'static/[ext]/[name]-[hash].[ext]'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
brotliSize: false,
|
|
||||||
chunkSizeWarningLimit: 2000
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user