forked from aikar/timings
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpostcss.config.js
42 lines (39 loc) · 845 Bytes
/
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
/*
* Copyright (c) (2017) - Aikar's Minecraft Timings Parser
*
* Written by Aikar <[email protected]>
* + Contributors (See AUTHORS)
*
* http://aikar.co
* http://starlis.com
*
* @license MIT
*
*/
const path = require('path');
const cssnext = require('postcss-cssnext');
const cssnano = require('cssnano');
const mqpacker = require('css-mqpacker');
module.exports = (ctx) => {
const isProduction = ctx.environment === 'production';
let plugins = [
cssnext({
compress: isProduction,
messages: !isProduction
}),
];
if (isProduction) {
plugins.push(cssnano({
discardComments: {
removeAll: true
},
autoprefixer: false,
styleCache: path.resolve('.cache/postcss'),
sourcemap: true
}));
plugins.push(mqpacker());
}
return {
plugins: plugins
};
};