Skip to content

Commit 49f7db9

Browse files
committed
refactor: isolate PostCSS config
1 parent 25befa4 commit 49f7db9

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

postcss.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// 此文件不支持热更新,修改后需要重启生效
2+
export default {
3+
plugins: {
4+
'autoprefixer': {},
5+
6+
// https://github.com/wswmsword/postcss-mobile-forever
7+
'postcss-mobile-forever': {
8+
appSelector: '#app',
9+
viewportWidth: 375,
10+
maxDisplayWidth: 600,
11+
appContainingBlock: 'auto',
12+
border: true,
13+
},
14+
},
15+
}

src/types/components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// @ts-nocheck
33
// Generated by unplugin-vue-components
44
// Read more: https://github.com/vuejs/core/pull/3399
5+
// biome-ignore lint: disable
56
export {}
67

78
/* prettier-ignore */

vite.config.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import path from 'node:path'
22
import process from 'node:process'
33
import { loadEnv } from 'vite'
44
import type { ConfigEnv, UserConfig } from 'vite'
5-
import viewport from 'postcss-mobile-forever'
6-
import autoprefixer from 'autoprefixer'
75
import { createVitePlugins } from './build/vite'
86
import { exclude, include } from './build/vite/optimize'
97

@@ -29,29 +27,12 @@ export default ({ mode }: ConfigEnv): UserConfig => {
2927

3028
resolve: {
3129
alias: {
32-
'~@': path.join(__dirname, './src'),
3330
'@': path.join(__dirname, './src'),
3431
'~': path.join(__dirname, './src/assets'),
3532
'~root': path.join(__dirname, '.'),
3633
},
3734
},
3835

39-
css: {
40-
postcss: {
41-
plugins: [
42-
autoprefixer(),
43-
// https://github.com/wswmsword/postcss-mobile-forever
44-
viewport({
45-
appSelector: '#app',
46-
viewportWidth: 375,
47-
maxDisplayWidth: 600,
48-
appContainingBlock: 'auto',
49-
border: true,
50-
}),
51-
],
52-
},
53-
},
54-
5536
build: {
5637
cssCodeSplit: false,
5738
chunkSizeWarningLimit: 2048,

0 commit comments

Comments
 (0)