-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web-ext: build with NODE_ENV=production #256175
Conversation
@wingdeans Do you want to add yourself as maintainer? |
727e827
to
f8a86c2
Compare
Apparently this was because Using NODE_ENV = "production";
npmInstallFlags = "--include=dev";
No thanks |
I wonder if we should instead be using |
I'm thinking of something like this: diff --git a/pkgs/build-support/node/build-npm-package/hooks/npm-config-hook.sh b/pkgs/build-support/node/build-npm-package/hooks/npm-config-hook.sh
index 486b0c2f8372df..1936c32b6c07dd 100644
--- a/pkgs/build-support/node/build-npm-package/hooks/npm-config-hook.sh
+++ b/pkgs/build-support/node/build-npm-package/hooks/npm-config-hook.sh
@@ -109,6 +109,9 @@ npmConfigHook() {
rm "$CACHE_MAP_PATH"
unset CACHE_MAP_PATH
+ # Set build NODE_ENV to "production" by default *after* `npm ci` and `npm rebuild` to avoid an implicit `--omit=dev`
+ export NODE_ENV="${NODE_ENV-production}"
+
if [ -n "${npmRoot-}" ]; then
popd
fi I'll do some testing and possibly open that as a PR to fix the underlying issue. Feel free to take that diff for this PR, though, since you came up with the idea and I'm not attached to attribution |
f8a86c2
to
f4a6b7a
Compare
Hey, any update on this PR? problem is unfortunately still there :( |
Co-authored-by: kirillrdy <[email protected]>
as per my comment in #256174 I think the issue has been resolved |
Confirmed fixed |
Description of changes
Fixes #256174
Setting
NODE_ENV
as an attribute results in this error:Instead it is set in the
preBuild
hook, just before it is needed.Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)