2
0

.pnpmfile.cjs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
  3. * SPDX-License-Identifier: MIT
  4. */
  5. 'use strict';
  6. /**
  7. * When using the PNPM package manager, you can use pnpmfile.js to workaround
  8. * dependencies that have mistakes in their package.json file. (This feature is
  9. * functionally similar to Yarn's "resolutions".)
  10. *
  11. * For details, see the PNPM documentation:
  12. * https://pnpm.io/pnpmfile#hooks
  13. *
  14. * IMPORTANT: SINCE THIS FILE CONTAINS EXECUTABLE CODE, MODIFYING IT IS LIKELY TO INVALIDATE
  15. * ANY CACHED DEPENDENCY ANALYSIS. After any modification to pnpmfile.js, it's recommended to run
  16. * "rush update --full" so that PNPM will recalculate all version selections.
  17. */
  18. module.exports = {
  19. hooks: {
  20. readPackage
  21. }
  22. };
  23. /**
  24. * This hook is invoked during installation before a package's dependencies
  25. * are selected.
  26. * The `packageJson` parameter is the deserialized package.json
  27. * contents for the package that is about to be installed.
  28. * The `context` parameter provides a log() function.
  29. * The return value is the updated object.
  30. */
  31. function readPackage(packageJson, context) {
  32. // // The karma types have a missing dependency on typings from the log4js package.
  33. // if (packageJson.name === '@types/karma') {
  34. // context.log('Fixed up dependencies for @types/karma');
  35. // packageJson.dependencies['log4js'] = '0.6.38';
  36. // }
  37. return packageJson;
  38. }