Designed for use with NodeJS projects made up of multiple sub-projects.
Allows you run scripts defined in package.json across multiple sub-projects
(e.g. run npm install and npm run build across multiple projects)
Supports npm or yarn (thanks to @mateuszluczak). Yarn is detected via
the presence of a yarn.lock file.
npm install --save-dev @ghnacker/subpackageTo use subpackage commands, you will first need to add a subPackages entry
to your parent project's package.json file:
{
"name": "my-awesome-project",
"version": "2.5.1",
"subPackages": [
"packages/sub-package-1",
"packages/sub-package-2"
]
}To use subpkg, add it to the start of scripts entries in your parent project's
package.json file:
"scripts": {
"postinstall": "subpkg install",
"build": "subpkg run build"
}With the configuration above in your parent project, you can type npm run build
(or yarn run build) to build all sub-packages.
MIT