-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpostcss.config.js
More file actions
36 lines (33 loc) · 669 Bytes
/
Copy pathpostcss.config.js
File metadata and controls
36 lines (33 loc) · 669 Bytes
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
35
36
const path = require('path')
module.exports = {
plugins: [
require('postcss-import')({
resolve (id) {
let aliasFound = false
const listAlias = [
{
alias: '@commonVars',
path: './src/styles/vars.css'
}
]
listAlias.forEach(item => {
if (id.match(new RegExp(item.alias, 'g'))) {
aliasFound = path.resolve(__dirname, item.path, id.slice(16))
}
})
return aliasFound || id
}
}),
require('postcss-preset-env')({
stage: 2,
features: {
'custom-properties': {
warnings: true,
preserve: false
}
}
}),
require('postcss-nested')(),
require('postcss-custom-media')()
]
}