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