/
index.js
33 lines (29 loc) · 905 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { build } from "esbuild";
import FastGlob from "fast-glob";
import path from "path";
import { aliasRelative } from "../src";
const example1 = path.resolve("./test/example");
const getFiles = async dir =>
(await FastGlob("**/*", { cwd: dir })).map(file => path.join(dir, file));
(async () => {
const files = await getFiles(example1);
build({
entryPoints: files,
outdir: "./test/out",
watch: false,
platform: "node",
format: "cjs",
logLevel: "info",
bundle: false,
plugins: [
aliasRelative({
aliases: {
"@base": path.resolve("."),
"@test": path.resolve("./test"),
"@app": path.resolve("./test/example/app"),
"@example": path.resolve("./test/example"),
},
}),
],
});
})();