|
|
|
@ -96,6 +96,9 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
@@ -96,6 +96,9 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
|
|
|
|
// 设置块大小警告限制提示
|
|
|
|
|
chunkSizeWarningLimit: 2000, |
|
|
|
|
}, |
|
|
|
|
esbuild: { |
|
|
|
|
drop: VITE_DROP_CONSOLE ? ['console', 'debugger'] : [], |
|
|
|
|
}, |
|
|
|
|
define: { |
|
|
|
|
// 在生产中启用/禁用@intlify/devtools支持,默认值false
|
|
|
|
|
__INTLIFY_PROD_DEVTOOLS__: false, |
|
|
|
@ -113,30 +116,12 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
@@ -113,30 +116,12 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
|
|
|
|
javascriptEnabled: true, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
postcss: { |
|
|
|
|
plugins: [ |
|
|
|
|
{ |
|
|
|
|
// 消除含义中文vxe-table样式@charset:UTF-8警告
|
|
|
|
|
postcssPlugin: 'internal:charset-removal', |
|
|
|
|
AtRule: { |
|
|
|
|
charset: (atRule) => { |
|
|
|
|
if (atRule.name === 'charset') { |
|
|
|
|
atRule.remove(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
// 项目使用的vite插件太多,单独提取管理,便于维护
|
|
|
|
|
plugins: createVitePlugins(viteEnv, isBuild), |
|
|
|
|
// 默认预构建是根据index.html来检测需要哪些预构建的依赖项
|
|
|
|
|
// 配置预构建原因请参考: https://cn.vitejs.dev/guide/dep-pre-bundling.html#the-why
|
|
|
|
|
optimizeDeps: { |
|
|
|
|
esbuildOptions: { |
|
|
|
|
drop: ['debugger', 'console'] |
|
|
|
|
}, |
|
|
|
|
// 首次启动vite预加载强制包含依赖
|
|
|
|
|
include: [ |
|
|
|
|
'@vue/runtime-core', |
|
|
|
|