-
Notifications
You must be signed in to change notification settings - Fork 0
/
postcss.config.js
executable file
·42 lines (41 loc) · 1.35 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
35
36
37
38
39
40
41
42
//var smartImport = require("postcss-smart-import")
const path = require('path')
module.exports = ({file, options, env}) => {
var debug = true;
console.log(options)
return {
parser: 'postcss-scss',
plugins: {
//smartImport(),
'postcss-import': {
root: file.dirname,
// addModulesDirectories: [path.resolve(__dirname, './font-awesome')]
},
'postcss-custom-media': require('postcss-custom-media'),
"postcss-url": options.postcssurl ? [
{
url: 'copy',
basePath: path.resolve(""),
// dir to copy assets
assetsPath: path.resolve("./buildServer"),
// using hash names for assets (generates from asset content)
// useHash: true
},
{
filter: '**/fontawesome-*',
url(asset) {
console.log("filterfont")
var url = asset.url.replace("buildServer/", '');
return url;
},
multi:true
// using hash names for assets (generates from asset content)
// useHash: true
}] : false,
// 'postcss-preset-env': options.cssnext && !debug ? options.cssnext : false
'postcss-preset-env': options.cssnext
//env == 'production' ? options.autoprefixer : false,
// 'cssnano': env === 'production' ? options.cssnano : false
}
}
}