- Create new monorepo directory. (If needed, run
git init
and add appropriate.gitignore
file.) - Run
lerna init
. If versions of each packages differ from each other, removeversion
fromlerna.json
. - Run
npm install
- Copy existing packages to
packages
folder. - Remove previous dependencies with each other from all packages.
- Set
prepublishOnly
ofpackage.json
of each file tonpm run build
. (If needed, make "tsconfig.json" at "packages" folder for package references, "tsconfig.settings.json" for common settings to extended by each package's tsconfig.json.) - For packages referencing other package(s), set
references
oftsconfig.json
file. - Set
outDir
androotDir
oftsconfig.json
of each package to appropriate values if needed. - Set
main
andtypes
ofpackage.json
of each package to appropriate values. - Add new dependencies with
lerna add <package_name> <glob_pattern>
This will add package with name<package_name>
to lerna-maintained packages matching<glob_pattern>
. - If needed run
lerna bootstrap
(For most cases, step 6 will run this.) - Run
lerna run build
.
Created
January 23, 2019 00:47
-
-
Save amoretspero/21561d9cd60caad2f81503783faf95e9 to your computer and use it in GitHub Desktop.
Configuring lerna with existing typescript packages.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment