Commit 2e6c0d78 by zhangxingmin

push

parent 024db790
// vite.config.mjs(保持内容不变,仅改扩展名) // vite.config.mjs
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue'; import vue from '@vitejs/plugin-vue';
import path from 'path'; import { fileURLToPath, URL } from 'node:url';
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [vue({/* 自定义元素配置 */})],
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('uni-')
}
}
})
],
resolve: { resolve: {
alias: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) }
'@': path.resolve(__dirname, './src'),
}
}, },
css: { css: {
preprocessorOptions: { preprocessorOptions: {
scss: { scss: {
additionalData: `@import "@/styles/variables.scss";` additionalData: `@import "@/styles/variables.scss";` // 全局注入变量 [6]
},
less: {
math: 'always'
} }
} }
}, },
build: { build: {
commonjsOptions: { minify: 'terser',
transformMixedEsModules: true 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