File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
import esbuild from "esbuild" ;
2
2
import { spawn , spawnSync } from "child_process" ;
3
+ import fs from "fs/promises" ;
3
4
4
5
const devBuild = process . env . DEV === "true" ;
5
6
const minify = ! devBuild ;
6
7
const nodeEnv = devBuild ? '"development"' : '"production"' ;
7
8
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
+
8
20
const runTailwindBuild = ( watch ) => {
9
21
console . log ( "Building Tailwind CSS..." ) ;
10
22
try {
@@ -35,7 +47,6 @@ const runTailwindBuild = (watch) => {
35
47
const options = {
36
48
entryPoints : [
37
49
"./src/index.tsx" ,
38
- "./src/vanilla.example.js" ,
39
50
] ,
40
51
outdir : "public/build/" ,
41
52
format : "esm" ,
@@ -44,7 +55,7 @@ const options = {
44
55
".ts" : "tsx" ,
45
56
".tsx" : "tsx" ,
46
57
".woff2" : "file" ,
47
- ".woff" : "file"
58
+ ".woff" : "file" ,
48
59
} ,
49
60
plugins : [ ] ,
50
61
minify : minify ,
You can’t perform that action at this time.
0 commit comments