-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
29 lines (26 loc) · 706 Bytes
/
build.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
const esbuild = require("esbuild");
const fs = require("fs");
const path = require("path");
const {
PerspectiveEsbuildPlugin,
} = require("@finos/perspective-esbuild-plugin");
async function build() {
await esbuild.build({
entryPoints: ["src/index.js"],
plugins: [PerspectiveEsbuildPlugin()],
outdir: "dist",
format: "esm",
bundle: true,
loader: {
".css": "text",
".ttf": "file",
".arrow": "file",
},
assetNames: "[name]",
});
fs.writeFileSync(
path.join(__dirname, "dist/index.html"),
fs.readFileSync(path.join(__dirname, "src/index.html")).toString()
);
}
build();