1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | const fs = require('fs');
|
13 |
|
14 |
|
15 | const filePath = './neos-normalize.css';
|
16 |
|
17 |
|
18 | const beautifiedTextArray = [];
|
19 |
|
20 |
|
21 | const originalText = fs.readFileSync(filePath, 'utf-8');
|
22 |
|
23 |
|
24 | originalText.split('\n').forEach((line) => {
|
25 |
|
26 | if(line === '@charset "UTF-8";') {
|
27 | return;
|
28 | }
|
29 |
|
30 |
|
31 | if(line === '/* ==================================================') {
|
32 | beautifiedTextArray.push('');
|
33 | }
|
34 |
|
35 |
|
36 | if(line.includes('0.5em')) {
|
37 | line = line.replace('0.5em', '.5em');
|
38 | }
|
39 |
|
40 |
|
41 | beautifiedTextArray.push(line);
|
42 |
|
43 |
|
44 | if(line.startsWith('/*!') || line === ' * ================================================== */') {
|
45 | beautifiedTextArray.push('');
|
46 | }
|
47 | });
|
48 |
|
49 |
|
50 | const beautifiedText = beautifiedTextArray.join('\n');
|
51 |
|
52 |
|
53 | fs.writeFileSync(filePath, beautifiedText);
|