UNPKG

453 BJavaScriptView Raw
1import { writeFile } from 'fs';
2import { resolve } from 'path';
3import CleanCSS from 'clean-css';
4
5import compileCSS from './compile';
6
7const entryPointFilePath = process.argv[2];
8const CSS = compileCSS(entryPointFilePath);
9const format = new CleanCSS({
10 level: 0,
11 format: 'beautify',
12 inline: ['none'],
13});
14const { styles: formattedCSS } = format.minify(CSS);
15writeFile(resolve('stylesheet.css'), formattedCSS, (err) => {
16 if (err) throw err;
17});