diff options
Diffstat (limited to 'vid-webpack-master/processCss.js')
-rw-r--r-- | vid-webpack-master/processCss.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vid-webpack-master/processCss.js b/vid-webpack-master/processCss.js new file mode 100644 index 000000000..81953b9d5 --- /dev/null +++ b/vid-webpack-master/processCss.js @@ -0,0 +1,20 @@ +const next = require('postcss-cssnext'); +const modules = require('postcss-modules'); +const postcss = require('postcss'); + +const processCss = function(file, done) { + postcss([ + next, + modules({ + getJSON: function(filename, json) { + file.rename(file.path + '.json') + done(JSON.stringify(json)) + } + }) + ]).process(file.content, { + from: file.path, + to: file.path + }).catch(function(err) { + throw err + }) +} |