File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ const publicPath = process.env.ASSET_PUBLIC_PATH || "/assets/dist/";
6464const isProd =
6565 process . env . NODE_ENV === "production" ||
6666 process . env . RAILS_ENV === "production" ;
67+ const nodeEnv = isProd ? "production" : "development" ;
6768
6869const ensureDir = ( path : string ) => {
6970 mkdirSync ( path , { recursive : true } ) ;
@@ -86,6 +87,8 @@ const bunArgs = [
8687 "--splitting" ,
8788 "--public-path" ,
8889 publicPath ,
90+ "--define" ,
91+ `process.env.NODE_ENV="${ nodeEnv } "` ,
8992 "--entry-naming" ,
9093 "[dir]-[name].[ext]" ,
9194 "--chunk-naming" ,
@@ -100,6 +103,8 @@ if (isProd) {
100103 bunArgs . push ( "--minify" ) ;
101104}
102105
106+ console . log ( `bun ${ bunArgs . join ( " " ) } ` ) ;
107+
103108const bunProc = Bun . spawn ( [ "bun" , ...bunArgs ] , {
104109 cwd : frontendRoot ,
105110 stdout : "inherit" ,
You can’t perform that action at this time.
0 commit comments