Files
nixpkgs/pkgs/by-name/we/webpack-cli/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

68 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
fetchYarnDeps,
yarnConfigHook,
yarnBuildHook,
yarnInstallHook,
nodejs,
gitUpdater,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "webpack-cli";
version = "6.0.1";
src = fetchFromGitHub {
owner = "webpack";
repo = "webpack-cli";
tag = "webpack-cli@${finalAttrs.version}";
hash = "sha256-teQWaWWt3rKHEVbj3twt8WQXQO9HuzIBNuvFUfRmxqY=";
};
yarnKeepDevDeps = true;
yarnOfflineCache = fetchYarnDeps {
yarnLock = finalAttrs.src + "/yarn.lock";
hash = "sha256-iYyH1/ZyNKq4MqMcCl7y5WvDnuGnRY0sj8hHsQhe7z4=";
};
nativeBuildInputs = [
yarnConfigHook
yarnBuildHook
yarnInstallHook
# Needed for executing package.json scripts
nodejs
];
preInstall = ''
cp -r node_modules/* packages/webpack-cli/node_modules/
cp yarn.lock packages/webpack-cli/yarn.lock
cd packages/webpack-cli
'';
# Removes dangling symlinks that are created as part of the `yarn pack` process.
# They are not needed at runtime, so it's safe to remove them.
postInstall = ''
rm -rf $out/lib/node_modules/webpack-cli/node_modules/{.bin,webpack-cli,create-new-webpack-app,@webpack-cli}
'';
postFixup = ''
mv $out/bin/webpack-cli $out/bin/webpack
'';
passthru.updateScript = gitUpdater {
rev-prefix = "webpack-cli@";
};
meta = {
changelog = "https://github.com/webpack/webpack-cli/blob/webpack-cli%2540${finalAttrs.version}/CHANGELOG.md";
description = "Webpack's Command Line Interface";
homepage = "https://webpack.js.org/api/cli/";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ pyrox0 ];
mainProgram = "webpack";
};
})