From f9bc305acaaf26bf3c5ef4ae49f7b5a20c9c1dfe Mon Sep 17 00:00:00 2001 From: f0x52 Date: Mon, 21 Jun 2021 19:46:10 +0200 Subject: new styling for frontpage, update login and authorize templates (#46) * 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 --- web/source/build.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 web/source/build.js (limited to 'web/source/build.js') diff --git a/web/source/build.js b/web/source/build.js new file mode 100644 index 000000000..e32fa6da5 --- /dev/null +++ b/web/source/build.js @@ -0,0 +1,23 @@ +"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"); +}); -- cgit v1.2.3