Commit 2e6c0d78 by zhangxingmin

push

parent 024db790
// vite.config.mjs(保持内容不变,仅改扩展名)
// vite.config.mjs
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';
import { fileURLToPath, URL } from 'node:url';
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('uni-')
}
}
})
],
plugins: [vue({/* 自定义元素配置 */})],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
}
alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) }
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "@/styles/variables.scss";`
},
less: {
math: 'always'
additionalData: `@import "@/styles/variables.scss";` // 全局注入变量 [6]
}
}
},
build: {
commonjsOptions: {
transformMixedEsModules: true
minify: 'terser',
terserOptions: {
compress: {
drop_console: true // 生产环境移除 console [10]
}
}
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment