Skip to content

Commit 6ff9fa9

Browse files
committed
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)
1 parent df75ed6 commit 6ff9fa9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

pkgs/by-name/es/eslint/package.nix

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,11 @@ buildNpmPackage' rec {
3131
'';
3232

3333
npmDepsHash = "sha256-F3EUANBvniczR7QxNfo1LlksYPxXt16uqJDFzN6u64Y=";
34+
npmInstallFlags = [ "--omit=dev" ];
3435

3536
dontNpmBuild = true;
3637
dontNpmPrune = true;
3738

38-
postFixup = ''
39-
# Remove broken symlink
40-
rm $out/lib/node_modules/eslint/node_modules/eslint-config-eslint
41-
'';
42-
4339
meta = {
4440
description = "Find and fix problems in your JavaScript code";
4541
homepage = "https://eslint.org";

0 commit comments

Comments
 (0)