Skip to content

Commit 1df8446

Browse files
committed
Add use_execroot_entry_point param on Next.js macros for compatibility with kwargs
1 parent 58aff6f commit 1df8446

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

contrib/nextjs/defs.bzl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def nextjs(
173173
**kwargs
174174
)
175175

176-
def nextjs_build(name, config, srcs, next_js_binary, data = [], **kwargs):
176+
def nextjs_build(name, config, srcs, next_js_binary, data = [], use_execroot_entry_point = True, **kwargs):
177177
"""Build the Next.js production artifact.
178178
179179
See https://nextjs.org/docs/pages/api-reference/cli/next#build
@@ -191,6 +191,7 @@ def nextjs_build(name, config, srcs, next_js_binary, data = [], **kwargs):
191191
192192
See main docstring above for example usage.
193193
194+
use_execroot_entry_point: passed directly to js_run_binary
194195
**kwargs: Other attributes passed to all targets such as `tags`, env
195196
"""
196197
js_run_binary(
@@ -202,7 +203,7 @@ def nextjs_build(name, config, srcs, next_js_binary, data = [], **kwargs):
202203
chdir = native.package_name(),
203204
mnemonic = "NextJs",
204205
progress_message = "Compile Next.js app %{label}",
205-
use_execroot_entry_point = True,
206+
use_execroot_entry_point = use_execroot_entry_point,
206207
**kwargs
207208
)
208209

@@ -269,7 +270,7 @@ def nextjs_dev(name, config, srcs, data, next_js_binary, **kwargs):
269270
# Standalone Next.js build & server binary.
270271
# ---------------------------------------------------------------------------------------------
271272

272-
def nextjs_standalone_build(name, config, srcs, next_js_binary, data = [], **kwargs):
273+
def nextjs_standalone_build(name, config, srcs, next_js_binary, data = [], use_execroot_entry_point = True, **kwargs):
273274
"""Compile a standalone Next.js application.
274275
275276
See https://nextjs.org/docs/app/api-reference/config/next-config-js/output#automatically-copying-traced-files
@@ -291,6 +292,7 @@ def nextjs_standalone_build(name, config, srcs, next_js_binary, data = [], **kwa
291292
srcs: the sources to include in the build, including any transitive deps
292293
next_js_binary: the Next.js binary to use for building
293294
data: the data files to include in the build
295+
use_execroot_entry_point: passed directly to js_run_binary
294296
**kwargs: Other attributes passed to all targets such as `tags`, env
295297
"""
296298

@@ -328,7 +330,7 @@ def nextjs_standalone_build(name, config, srcs, next_js_binary, data = [], **kwa
328330
chdir = native.package_name(),
329331
mnemonic = "NextJs",
330332
progress_message = "Compile Next.js standalone app %{label}",
331-
use_execroot_entry_point = True,
333+
use_execroot_entry_point = use_execroot_entry_point,
332334
**kwargs
333335
)
334336

0 commit comments

Comments
 (0)