0.1.4 • Published 7 years ago
lerna-jsconfig v0.1.4
Lerna-JSConfig
Generate jsconfig.json allowing VSCode to \"Open Definition\" your Lerna packages.
Install
$ npm i --save lerna-jsconfigUsage
Add a
jsconfig.jsonto your Lerna root{ "compilerOptions": { "baseUrl": ".", "paths": {} } }From inside your Lerna project:
$ npx --no-install lerna-jsconfig
CLI Output
lerna notice cli v3.4.3
lerna success found 13 packages
jsconfig.json was updated in Lerna root: /Users/username/repos/lerna-project-dir
{ compilerOptions:
{ baseUrl: '.',
paths:
{ '@project/comp-a': [Array],
'@project/comp-b': [Array],
'@project/comp-c': [Array] } } }JSON Output
<lerna-root>/tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@project/comp-a": [
"./packages/comp-a/src/index.js"
],
"@project/comp-b": [
"./packages/comp-b/src/index.js"
],
"@project/comp-b": [
"./packages/comp-b/src/index.js"
]
}
}
}$ npx --no-install lerna-jsconfigWARNING!
- This will overwrite any existing
jsconfig.jsonpaths. - You MUST have a
jsconfig.jsonin your Lerna root before running this. - You MUST have a
package.jsonwith amainormoduleentry point in thepackage.jsonfiles for each or your packages.