%global npm_name compression-webpack-plugin Name: nodejs-compression-webpack-plugin Version: 10.0.0 Release: 3%{?dist} Summary: Prepare compressed versions of assets to serve them with Content-Encoding License: MIT Group: Development/Libraries URL: https://github.com/webpack-contrib/compression-webpack-plugin Source0: https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz Source1: https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz Source2: https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz Source3: https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz Source4: https://registry.npmjs.org/compression-webpack-plugin/-/compression-webpack-plugin-10.0.0.tgz Source5: https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz Source6: https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.4.tgz Source7: https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz Source8: https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz Source9: https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz Source10: https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz Source11: https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz Source12: https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz Source13: nodejs-compression-webpack-plugin-%{version}-package-lock.json BuildRequires: npm >= 7 BuildRequires: nodejs-packaging # The prep section runs node directly, so this is needed unconditionally. It # also works around https://issues.redhat.com/browse/RHEL-137712 on RHEL 10 # before 10.3, where the nodejs major version macro does not resolve without # node in the buildroot. BuildRequires: /usr/bin/node BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch Provides: npm(%{npm_name}) = %{version} Provides: bundled(npm(@types/json-schema)) = 7.0.15 Provides: bundled(npm(ajv)) = 8.20.0 Provides: bundled(npm(ajv-formats)) = 2.1.1 Provides: bundled(npm(ajv-keywords)) = 5.1.0 Provides: bundled(npm(compression-webpack-plugin)) = 10.0.0 Provides: bundled(npm(fast-deep-equal)) = 3.1.3 Provides: bundled(npm(fast-uri)) = 3.1.4 Provides: bundled(npm(json-schema-traverse)) = 1.0.0 Provides: bundled(npm(randombytes)) = 2.1.0 Provides: bundled(npm(require-from-string)) = 2.0.2 Provides: bundled(npm(safe-buffer)) = 5.2.1 Provides: bundled(npm(schema-utils)) = 4.3.3 Provides: bundled(npm(serialize-javascript)) = 6.0.2 AutoReq: no AutoProv: no %define npm_cache_dir npm_cache_%{name}-%{version}-%{release} %description %{summary} %prep mkdir -p %{npm_cache_dir} # npm ci installs the tree recorded in the lockfile: every entry carries a # resolved URL and an integrity hash, and npm serves the tarballs from the # cache primed here by content hash. No registry access is needed. for src in %{sources}; do case "$src" in *.tgz) npm cache add --cache %{npm_cache_dir} "$src" ;; *-package-lock.json) cp "$src" package-lock.json ;; esac done # Derive package.json from the lockfile so the two cannot disagree. node -e ' const fs = require("fs"); const lock = JSON.parse(fs.readFileSync("package-lock.json")); fs.writeFileSync("package.json", JSON.stringify({ name: lock.name, version: lock.version, dependencies: lock.packages[""].dependencies }, null, 2) + "\n"); ' %build npm ci --legacy-peer-deps --offline --cache %{_builddir}/%{npm_cache_dir} --omit optional %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/node_modules %{buildroot}%{nodejs_sitelib}/%{npm_name} # npm creates a scope directory for every scope named in the lockfile, including # scopes whose packages were all omitted, which leaves empty dirs behind. # -delete implies -depth, so nested empties go bottom-up in a single pass. find %{buildroot}%{nodejs_sitelib}/%{npm_name} -type d -empty -delete cp -pfr node_modules/%{npm_name}/dist %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/package.json %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/types %{buildroot}%{nodejs_sitelib}/%{npm_name} %clean rm -rf %{buildroot} %{npm_cache_dir} %files %{nodejs_sitelib}/%{npm_name} %license node_modules/%{npm_name}/LICENSE %doc node_modules/%{npm_name}/README.md %changelog * Thu Jul 30 2026 Zach Huntington-Meath - 10.0.0-3 - Regenerate with correct npm2rpm strategy * Thu Jul 30 2026 Zach Huntington-Meath 10.0.0-1 - Update to 10.0.0 * Thu Jul 30 2026 Zach Huntington-Meath 10.0.0-3 - Update to 10.0.0 * Tue Dec 23 2025 Ewoud Kohl van Wijngaarden 10.0.0-2 - Rebuild vendor cache for NodeJS 22 * Thu Apr 11 2024 Evgeni Golov 10.0.0-1 - Add nodejs-compression-webpack-plugin generated by npm2rpm using the bundle strategy