0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 14:10:33 +03:00

eslint: avoid dev dependencies to reduce closure size

Omitting npm dev dependencies reduces eslint closure size significantly.
This is helpful when using eslint in build pipelines. Following numbers
from `nix path-info --size --closure-size --human-readable` on
aarch64-darwin.

size of:    eslint    closure  remark:
before:  438.3 MiB    2.7 GiB  (includes apple-sdk, compiler, etc.)
after:    10.6 MiB  202.1 MiB  (npmInstallFlags --omit=dev)
This commit is contained in:
Alain Lehmann 2025-03-22 15:17:08 +01:00
parent df75ed657f
commit 6ff9fa9799

View file

@ -31,15 +31,11 @@ buildNpmPackage' rec {
'';
npmDepsHash = "sha256-F3EUANBvniczR7QxNfo1LlksYPxXt16uqJDFzN6u64Y=";
npmInstallFlags = [ "--omit=dev" ];
dontNpmBuild = true;
dontNpmPrune = true;
postFixup = ''
# Remove broken symlink
rm $out/lib/node_modules/eslint/node_modules/eslint-config-eslint
'';
meta = {
description = "Find and fix problems in your JavaScript code";
homepage = "https://eslint.org";