.pnpmfile.cjs 1.3 KB

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