-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathbundle.js
More file actions
22 lines (18 loc) · 786 Bytes
/
bundle.js
File metadata and controls
22 lines (18 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import path from "path";
import * as fs from "fs";
import { Bundler as scssBundler } from "scss-bundle";
import { Bundler as stylusBundler } from "stylus-bundle";
const __dirname = path.dirname(new URL(import.meta.url).pathname);
const projectDirectory = path.resolve(__dirname, "./");
const scss = async () => {
const bundler = new scssBundler(undefined, projectDirectory);
const result = await bundler.bundle("./_typesettings.scss");
fs.writeFileSync("_typesettings.bundle.scss", result.bundledContent, "utf8");
};
const stylus = async () => {
const bundler = new stylusBundler(undefined, projectDirectory);
const result = await bundler.bundle("./_typesettings.styl");
fs.writeFileSync("_typesettings.bundle.styl", result.bundledContent, "utf8");
};
scss();
stylus();