@pnpm/better-defaults
v0.2.2
Published
Improved defaults for pnpm
Readme
@pnpm/better-defaults
Improved defaults for pnpm
What it changes
- Sets enableGlobalVirtualStore to
true. - Sets enablePrePostScripts to
false. - Sets hoistPattern to an empty array, disabling hoisting.
- Sets ignorePatchFailures to
false. - Sets optimisticRepeatInstall to
true. - Sets resolutionMode to
lowest-direct. - Sets verifyDepsBeforeRun to
install.
You can extend or override these settings in your own .pnpmfile.cjs.
Installation
pnpm add --config @pnpm/better-defaultsThis will add @pnpm/better-defaults to the configDependencies field in your pnpm-workspace.yaml.
Usage
If you don't have a pnpmfile in your project, then add this to pnpm-workspace.yaml:
pnpmfile: node_modules/.pnpm-config/@pnpm/better-defaults/pnpmfile.cjsIf you have a .pnpmfile.cjs already in your project, then you can reexport the updateConfig hooks from @pnpm/better-defaults. This should be your .pnpmfile.cjs:
module.exports = {
hooks: {
...require('.pnpm-config/@pnpm/better-defaults/pnpmfile.cjs').hooks,
// Other hooks in your project
}
}Alternatively, you may have other changes in your updateConfig hook:
const { updateConfig: makeBetterDefaults } = require('.pnpm-config/@pnpm/better-defaults/pnpmfile.cjs').hooks
module.exports = {
hooks: {
updateConfig (config) {
return {
...makeBetterDefaults(config),
hoistPattern: ['*'],
}
}
}
}License
MIT
