mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-19 12:35:37 +08:00
【调整】打包配置调整
This commit is contained in:
@@ -105,9 +105,8 @@ export default defineConfig({
|
||||
// targetDir: 'allinssl-gitlab',
|
||||
// discardChanges: true,
|
||||
// },
|
||||
|
||||
{
|
||||
repo: 'https://github.com/allinssl/allinssl.git',
|
||||
repo: 'git@github.com:allinssl/allinssl.git',
|
||||
branch: '1.0.7',
|
||||
targetDir: 'allinssl-github',
|
||||
discardChanges: true,
|
||||
@@ -184,6 +183,18 @@ export default defineConfig({
|
||||
chunkSizeWarningLimit: 800, // 警告阈值
|
||||
assetsInlineLimit: 2048, // 小于2kb的资源内联
|
||||
modulePreload: false, // 禁用预加载
|
||||
// SPA路由支持:生成404.html作为回退页面
|
||||
rollupOptions: {
|
||||
input: {
|
||||
main: path.resolve(__dirname, 'index.html'),
|
||||
},
|
||||
output: {
|
||||
// 确保资源路径正确
|
||||
assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
|
||||
chunkFileNames: 'static/js/[name]-[hash].js',
|
||||
entryFileNames: 'static/js/[name]-[hash].js',
|
||||
},
|
||||
},
|
||||
terserOptions: {
|
||||
// 打包后移除console和注释
|
||||
compress: {
|
||||
@@ -197,6 +208,7 @@ export default defineConfig({
|
||||
},
|
||||
strictDeprecations: true, // 严格弃用
|
||||
output: {
|
||||
// 确保资源路径正确,支持SPA路由
|
||||
entryFileNames: `${packPath}js/[name]-[hash].js`,
|
||||
chunkFileNames: `${packPath}js/[name]-[hash].js`,
|
||||
assetFileNames: (chunkInfo) => {
|
||||
@@ -228,7 +240,4 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
},
|
||||
test: {
|
||||
include: ['src/**/*.spec.ts'],
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user