-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpostcss.config.js
More file actions
28 lines (26 loc) · 918 Bytes
/
postcss.config.js
File metadata and controls
28 lines (26 loc) · 918 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
/**
* Based on https://github.com/voorhoede/front-end-tooling-recipes/tree/master/postcss-process-and-watch
* in config file format: https://github.com/michael-ciniawsky/postcss-load-config#postcssconfigjs-or-postcssrcjs
* Options reference: http://api.postcss.org/global.html#processOptions
*/
import atImport from 'postcss-import'
import autoprefixer from 'autoprefixer'
import cssnano from 'cssnano'
import customProperties from 'postcss-custom-properties'
import merge from 'lodash/merge'
const isProduction = (process.env.NODE_ENV === 'production')
export default (ctx) => merge({
from: 'src/index.js',
to: 'public/bundle.css',
map: {
annotation: true,
inline: false,
prev: {},
},
plugins: [
atImport(),
// customProperties(),
autoprefixer({ browsers: 'last 2 versions, not ie <= 10, not ie_mob <= 10' }),
cssnano({ discardComments: { removeAll: true } }),
]
}, ctx)