-
Notifications
You must be signed in to change notification settings - Fork 53
/
build.js
36 lines (29 loc) · 1.05 KB
/
build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const sass = require('sass');
const fs = require('fs');
const autoprefixer = require('autoprefixer');
const postcss = require('postcss')
async function renderScss(filename) {
const inFile = `./scss/${filename}.scss`;
const outFile = `./public_html/css/${filename}.css`;
console.log(`Converting ${inFile} to css`);
const output = sass.compile(inFile, {
loadPaths: ['./scss/'],
style: "compressed",
});
console.log(`Applying autoprefixer`);
const result = await postcss([autoprefixer]).process(output.css, { from: undefined });
console.log(`Writing to ${outFile}`);
fs.writeFileSync(outFile, result.css);
}
function copyDumper() {
console.log("Copying dumper companion");
fs.copyFileSync("./dumper-companion/index.js", "./public_html/js/dumper-companion.js");
fs.copyFileSync("./dumper-companion/style.css", "./public_html/css/dumper-companion.css");
}
async function build() {
await renderScss('main_rtl');
await renderScss('main_ltr');
await renderScss('platforms');
copyDumper();
}
build();