chore: 优化postcss配置
- 移除autoprefixer的浏览器版本覆盖,使用package.json来定义, - browerserlist定义对齐vite的构建目标 https://vite.dev/config/build-options.html#build-target - atRule中charset已经限定配置charset,判断多余 - 顺手删了~路径别名,此项未使用,且tsconfig也没配置
This commit is contained in:
parent
b5a4ebe2f6
commit
7784709cae
@ -84,5 +84,11 @@
|
||||
"engines": {
|
||||
"node": ">=18.18.0",
|
||||
"npm": ">=8.9.0"
|
||||
}
|
||||
},
|
||||
"browserslist": [
|
||||
"Chrome >= 87",
|
||||
"Edge >= 88",
|
||||
"Safari >= 14",
|
||||
"Firefox >= 78"
|
||||
]
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ export default defineConfig(({ mode, command }) => {
|
||||
base: env.VITE_APP_CONTEXT_PATH,
|
||||
resolve: {
|
||||
alias: {
|
||||
'~': path.resolve(__dirname, './'),
|
||||
'@': path.resolve(__dirname, './src')
|
||||
},
|
||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
||||
@ -43,16 +42,12 @@ export default defineConfig(({ mode, command }) => {
|
||||
postcss: {
|
||||
plugins: [
|
||||
// 浏览器兼容性
|
||||
autoprefixer({
|
||||
overrideBrowserslist: ['Android 4.1', 'iOS 7.1', 'Chrome > 31', 'ff > 31', 'ie >= 8']
|
||||
}),
|
||||
autoprefixer(),
|
||||
{
|
||||
postcssPlugin: 'internal:charset-removal',
|
||||
AtRule: {
|
||||
charset: (atRule) => {
|
||||
if (atRule.name === 'charset') {
|
||||
atRule.remove();
|
||||
}
|
||||
atRule.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user