1515
1616 -------------------------------------------------------------------*/
1717
18- import type { AssetGlob } from "@storm-software/build-tools" ;
19- import { build as esbuild } from "@storm-software/esbuild" ;
18+ import { build as esbuild , type ESBuildOptions } from "@storm-software/esbuild" ;
2019import stormStack from "@storm-stack/build-plugin/esbuild" ;
2120import { EntryPointsOption } from "../types" ;
2221
@@ -46,7 +45,7 @@ export interface NodeAppBuildOptions {
4645 *
4746 * @defaultValue []
4847 */
49- assets ?: ( AssetGlob | string ) [ ] ;
48+ assets ?: ESBuildOptions [ "assets" ] ;
5049
5150 /**
5251 * The output path of the build
@@ -65,7 +64,7 @@ export interface NodeAppBuildOptions {
6564 * @param projectRoot - The project root
6665 * @param entry - The entry point(s) of the project
6766 */
68- export const build = async (
67+ export const build = (
6968 projectRoot : string ,
7069 options : NodeAppBuildOptions = { }
7170) => {
@@ -75,14 +74,15 @@ export const build = async (
7574 ? [ options . entryPoints ]
7675 : options . entryPoints ;
7776
78- await esbuild ( [
77+ return esbuild ( [
7978 {
8079 entryPoints,
8180 projectRoot,
8281 outdir : options . outputPath || "dist" ,
8382 platform : "node" ,
8483 format : "cjs" ,
8584 bundle : true ,
85+ generatePackageJson : true ,
8686 minify : ! options . debug ,
8787 sourcemap : options . debug ,
8888 plugins : [
@@ -98,6 +98,7 @@ export const build = async (
9898 platform : "node" ,
9999 format : "esm" ,
100100 bundle : true ,
101+ generatePackageJson : true ,
101102 minify : ! options . debug ,
102103 sourcemap : options . debug ,
103104 plugins : [
0 commit comments