| | |
| | | import vue from '@vitejs/plugin-vue'; |
| | | import { resolve } from 'path'; |
| | | import { defineConfig, loadEnv, ConfigEnv } from 'vite'; |
| | | |
| | | import postCssPxToRem from "postcss-pxtorem" |
| | | const pathResolve = (dir: string): any => { |
| | | return resolve(__dirname, '.', dir); |
| | | }; |
| | |
| | | css: { |
| | | postcss: { |
| | | plugins: [ |
| | | { |
| | | postcssPlugin: 'internal:charset-removal', |
| | | AtRule: { |
| | | charset: (atRule) => { |
| | | if (atRule.name === 'charset') { |
| | | atRule.remove(); |
| | | } |
| | | postCssPxToRem({ |
| | | rootValue: 37.5, // 1rem的大小(控制1rem的大小 点位:px) |
| | | propList: ["*"], // 需要转换的属性,这里选择全部都进行转换 |
| | | exclude: (e:any) => { // 不包含 |
| | | if (/src(\\|\/)views(\\|\/)bigScreen(\\|\/)components(\\|\/)screen/.test(e)||/src(\\|\/)views(\\|\/)loginPage(\\|\/)loginPage/.test(e)||/src(\\|\/)views(\\|\/)loginPage(\\|\/)component(\\|\/)accountLogin/.test(e)) { // 指定生效页面(正则) |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | }), |
| | | ], |
| | | }, |
| | | }, |
| | | define: { |
| | | __VUE_I18N_LEGACY_API__: JSON.stringify(false), |