forked from mirrors/gotosocial
f9bc305aca
* new styling for frontpage, update login and authorize templates * run go fmt * add AssetBaseDir to command flag parsing * untested: move landing page to it's own router * go fmt, fix typo * fix package, adapt to proper Route structure
23 lines
702 B
JavaScript
23 lines
702 B
JavaScript
"use strict";
|
|
|
|
const fs = require("fs").promises;
|
|
const postcss = require('postcss');
|
|
const {parse} = require("postcss-scss");
|
|
|
|
const postcssPlugins = ["postcss-strip-inline-comments", "postcss-nested", "postcss-simple-vars", "postcss-color-function"].map((plugin) => require(plugin)());
|
|
|
|
let inputFile = `${__dirname}/style.css`;
|
|
let outputFile = `${__dirname}/../assets/bundle.css`;
|
|
|
|
fs.readFile(inputFile, "utf-8").then((input) => {
|
|
return parse(input);
|
|
}).then((ast) => {
|
|
return postcss(postcssPlugins).process(ast, {
|
|
from: "style.css",
|
|
to: "bundle.css"
|
|
});
|
|
}).then((bundle) => {
|
|
return fs.writeFile(outputFile, bundle.css);
|
|
}).then(() => {
|
|
console.log("Finished writing CSS bundle");
|
|
});
|