forked from xlzy520/uniapp-tailwind-uview-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
postcss.config.js
34 lines (33 loc) · 1.07 KB
/
postcss.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const path = require('path')
const purgecss = require('@fullhuman/postcss-purgecss')
module.exports = {
syntax: 'postcss-scss',
parser: require('postcss-comment'),
plugins: [
require('postcss-import')({
resolve(id, basedir, importOptions) {
if (id.startsWith('~@/')) {
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3))
} else if (id.startsWith('@/')) {
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2))
} else if (id.startsWith('/') && !id.startsWith('//')) {
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1))
}
return id
},
}),
// purgecss({
// content: ['./**/*.vue', './**/*.wxml', './**/*.html'],
// css: ['**/*.wxss', '**/*.css'],
// }),
require('autoprefixer')({
remove: process.env.UNI_PLATFORM !== 'h5',
}),
require('@dcloudio/vue-cli-plugin-uni/packages/postcss'),
require('tailwindcss')({ config: './tailwind.config.js' }),
require('postcss-class-rename')({
'\\\\:': '--',
'\\\\/': '_',
})
],
}