Skip to content

Commit 6b057e8

Browse files
committed
update
1 parent 8da55f4 commit 6b057e8

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

client/esbuild.mjs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
import esbuild from "esbuild";
22
import { spawn, spawnSync } from "child_process";
3+
import fs from "fs/promises";
34

45
const devBuild = process.env.DEV === "true";
56
const minify = !devBuild;
67
const nodeEnv = devBuild ? '"development"' : '"production"';
78

9+
async function copyFile(source, destination) {
10+
try {
11+
await fs.copyFile(source, destination);
12+
console.log(`File copied from ${source} to ${destination}`);
13+
} catch (error) {
14+
console.error('Error occurred while copying the file:', error);
15+
}
16+
}
17+
18+
void copyFile("./src/vanilla.example.js", "./public/build/vanilla.example.js");
19+
820
const runTailwindBuild = (watch) => {
921
console.log("Building Tailwind CSS...");
1022
try {
@@ -35,7 +47,6 @@ const runTailwindBuild = (watch) => {
3547
const options = {
3648
entryPoints: [
3749
"./src/index.tsx",
38-
"./src/vanilla.example.js",
3950
],
4051
outdir: "public/build/",
4152
format: "esm",
@@ -44,7 +55,7 @@ const options = {
4455
".ts": "tsx",
4556
".tsx": "tsx",
4657
".woff2": "file",
47-
".woff": "file"
58+
".woff": "file",
4859
},
4960
plugins: [],
5061
minify: minify,

0 commit comments

Comments
 (0)