forked from forestryio/forestry.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.postcssrc.js
27 lines (24 loc) · 790 Bytes
/
.postcssrc.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
// Learn more about PostCSS:
// https://github.com/postcss/postcss
var dotenv = require("dotenv")
/**
* Load env vars from .env if available
*/
dotenv.config()
module.exports = function(ctx = {}) {
const file = ctx.file
const opts = ctx.options || {}
const isProduction = (opts.env === "production") || (process.env.NODE_ENV === "production")
return {
parser: opts.parser ? opts.parser : "postcss-scss",
plugins: {
"precss": {},
"postcss-cssnext": {},
"postcss-cachebuster": (isProduction) ? {imagesPath: "/src", cssPath: "/src/img", type: "checksum"} : false,
"cssnano": (isProduction) ? {autoprefixer: false} : false,
"laggard": {},
"postcss-reporter": {},
"postcss-browser-reporter": (isProduction) ? {} : false
}
}
}