blob: 81953b9d5c23369611ad2413932776067f0cbd05 [file] [log] [blame]
Ittay Stern6f900cc2018-08-29 17:01:32 +03001const next = require('postcss-cssnext');
2const modules = require('postcss-modules');
3const postcss = require('postcss');
4
5const processCss = function(file, done) {
6 postcss([
7 next,
8 modules({
9 getJSON: function(filename, json) {
10 file.rename(file.path + '.json')
11 done(JSON.stringify(json))
12 }
13 })
14 ]).process(file.content, {
15 from: file.path,
16 to: file.path
17 }).catch(function(err) {
18 throw err
19 })
20}