Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Remove workspaces from package.json with custom Yarn plugin #32

Merged
merged 2 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .yarn/plugins/plugin-remove-workspaces-field.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
name: `plugin-remove-workspaces-field`,
factory: () => ({
hooks: {
beforeWorkspacePacking(workspace, rawManifest) {
delete rawManifest.workspaces;
},
},
}),
};
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/plugin-remove-workspaces-field.cjs
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"clean": "rimraf build",
"lint": "eslint src/ --ext .jsx,.js",
"prepack": "yarn clean && yarn build",
"remove-workspaces": "node remove_workspaces.js",
"restore-workspaces": "node restore_workspaces.js",
"test": "yarn lint"
},
"keywords": [
Expand Down
16 changes: 0 additions & 16 deletions remove_workspaces.js

This file was deleted.

8 changes: 0 additions & 8 deletions restore_workspaces.js

This file was deleted.