From 11901dde6fbeffff4f19dd7c1617f348b7f54c67 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Thu, 3 Feb 2022 21:47:58 +0100 Subject: [PATCH] Remove postinstall from package.json with custom Yarn plugin --- .yarn/plugins/plugin-remove-postinstall.cjs | 10 ++++++++++ .yarnrc.yml | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 .yarn/plugins/plugin-remove-postinstall.cjs diff --git a/.yarn/plugins/plugin-remove-postinstall.cjs b/.yarn/plugins/plugin-remove-postinstall.cjs new file mode 100644 index 00000000..03a26f8e --- /dev/null +++ b/.yarn/plugins/plugin-remove-postinstall.cjs @@ -0,0 +1,10 @@ +module.exports = { + name: 'plugin-remove-postinstall', + factory: () => ({ + hooks: { + beforeWorkspacePacking(workspace, rawManifest) { + delete rawManifest.scripts.postinstall; + }, + }, + }), +}; diff --git a/.yarnrc.yml b/.yarnrc.yml index 70af58a8..ad7a58ad 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,3 +1,6 @@ nodeLinker: node-modules +plugins: + - path: .yarn/plugins/plugin-remove-postinstall.cjs + yarnPath: .yarn/releases/yarn-3.1.0.cjs