HummingBirdAnimeClient/public/tools/css.js
Timothy J Warren 24edf55f44
All checks were successful
timw4mail/HummingBirdAnimeClient/PR-12 This commit looks good
Responsive updates for smaller screen sizes
2018-11-05 09:47:05 -05:00

29 lines
645 B
JavaScript

/**
* Script for optimizing css
*/
const fs = require('fs');
const postcss = require('postcss');
const atImport = require('postcss-import');
const cssNext = require('postcss-cssnext');
const cssNano = require('cssnano');
const css = fs.readFileSync('css/all.css', 'utf-8');
postcss()
.use(atImport())
.use(cssNext())
.use(cssNano({
autoprefixer: false,
colormin: false,
minifyFontValues: false,
options: {
sourcemap: false
}
}))
.process(css, {
from: 'css/all.css',
to: 'css/app.min.css'
}).then(result => {
fs.writeFileSync('css/app.min.css', result.css);
fs.writeFileSync('css/app.min.css.map', result.map);
});