diff options
author | 2021-06-21 19:46:10 +0200 | |
---|---|---|
committer | 2021-06-21 19:46:10 +0200 | |
commit | f9bc305acaaf26bf3c5ef4ae49f7b5a20c9c1dfe (patch) | |
tree | c7312570819f998a51ad79e950baf523ae6426f8 /web/source/build.js | |
parent | Deletes+unboosts (#52) (diff) | |
download | gotosocial-f9bc305acaaf26bf3c5ef4ae49f7b5a20c9c1dfe.tar.xz |
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
Diffstat (limited to 'web/source/build.js')
-rw-r--r-- | web/source/build.js | 23 |
1 files changed, 23 insertions, 0 deletions
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"); +}); |