Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
use await
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunarequest committed Nov 26, 2023
1 parent 40d3a2d commit 5b055c4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions build.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as esbuild from "esbuild";
import { globPlugin } from "esbuild-plugin-glob";
import fs from "node:fs";
import fs from "node:fs/promises";
import postcss, { Processor } from "postcss";
import cssnano from "cssnano";
import copy from "copy";
Expand Down Expand Up @@ -34,8 +34,8 @@ const production = process.env.NODE_ENV === "production";
console.log(chalk.blue(figlet.textSync("NightPDF")));
console.log(chalk.blue("Building...."));

fs.mkdirSync("out");
fs.mkdirSync("out/css");
await fs.mkdir("out");
await fs.mkdir("out/css");

if (production) {
plugins.push(
Expand Down Expand Up @@ -63,9 +63,9 @@ async function assemble(fn: Css): Promise<void> {
from: fn.in,
to: fn.out,
});
fs.writeFileSync(fn.out, postcss_out.css);
fs.writeFile(fn.out, postcss_out.css);
if (postcss_out.map) {
fs.writeFileSync(`${fn.out}.map`, postcss_out.map.toString());
fs.writeFile(`${fn.out}.map`, postcss_out.map.toString());
}
}

Expand Down

0 comments on commit 5b055c4

Please sign in to comment.