@@ -25,7 +25,7 @@ func NewDockerBundler(fsys afero.Fs) function.EszipBundler {
2525 return & dockerBundler {fsys : fsys }
2626}
2727
28- func (b * dockerBundler ) Bundle (ctx context.Context , slug , entrypoint , importMap string , staticFiles []string , output io.Writer ) (function.FunctionDeployMetadata , error ) {
28+ func (b * dockerBundler ) Bundle (ctx context.Context , slug , entrypoint , importMap string , staticFiles []string , usePackageJson bool , output io.Writer ) (function.FunctionDeployMetadata , error ) {
2929 meta := function .NewMetadata (slug , entrypoint , importMap , staticFiles )
3030 fmt .Fprintln (os .Stderr , "Bundling Function:" , utils .Bold (slug ))
3131 cwd , err := os .Getwd ()
@@ -62,9 +62,18 @@ func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap
6262 cmd = append (cmd , function .BundleFlags ... )
6363
6464 env := []string {}
65+ denoNoPackageJsonValue := "1"
66+ if usePackageJson {
67+ denoNoPackageJsonValue = "0"
68+ }
6569 if custom_registry := os .Getenv ("NPM_CONFIG_REGISTRY" ); custom_registry != "" {
6670 env = append (env , "NPM_CONFIG_REGISTRY=" + custom_registry )
6771 }
72+ if deno_no_package_json := os .Getenv ("DENO_NO_PACKAGE_JSON" ); deno_no_package_json != "" {
73+ env = append (env , "DENO_NO_PACKAGE_JSON=" + deno_no_package_json )
74+ } else {
75+ env = append (env , "DENO_NO_PACKAGE_JSON=" + denoNoPackageJsonValue )
76+ }
6877 // Run bundle
6978 if err := utils .DockerRunOnceWithConfig (
7079 ctx ,
0 commit comments