-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (31 loc) · 902 Bytes
/
index.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
// dependencies for mnml
var fs = require("fs")
var autoprefixer = require("autoprefixer")
var compressor = require('node-minify')
var postcss = require("postcss")
var atImport = require("postcss-import")
var cssvariables = require('postcss-css-variables')
var nested = require("postcss-nested")
var conditionals = require('postcss-conditionals')
var customMedia = require("postcss-custom-media")
// css to be processed
var css = fs.readFileSync("src/bldgs.css", "utf8")
// process css
var output = postcss([autoprefixer])
.use(atImport())
.use(cssvariables())
.use(nested())
.use(conditionals())
.use(customMedia())
.process(css, {
from: "./src/bldgs.css",
to: "./css/bldgs.css"
})
.css
fs.writeFile("css/bldgs.css", output, 'utf-8')
// Using Sqwish for CSS
new compressor.minify({
type: 'sqwish',
fileIn: './css/bldgs.css',
fileOut: './css/bldgs.min.css'
});