During library development, it can be painful/slow to rebuild the library each time to test it downstream. Instead of re-running the build-chain each iteration, it would be nice if the downstream package could install the library (from ./ instead of ./dist/src), and it would use uncompiled typescript when installed locally for dev, but use the compiled library when installed from npm
Proposed Solution
Use exports option in root to allow installation of uncompiled source
The consumer package.json can use exports option to route imports to the uncompiled source, e.g.
...
"exports": {
".": "./src"
},
...
This means that the uncompiled source can be imported without having to import my-lib/src/...
Add ts-package-config variable to allow for removal/modification of exports
Add a configuration option so that exports can be merged with the built package.json
During library development, it can be painful/slow to rebuild the library each time to test it downstream. Instead of re-running the build-chain each iteration, it would be nice if the downstream package could install the library (from
./instead of./dist/src), and it would use uncompiled typescript when installed locally for dev, but use the compiled library when installed from npmProposed Solution
Use
exportsoption in root to allow installation of uncompiled sourceThe consumer package.json can use
exportsoption to route imports to the uncompiled source, e.g.This means that the uncompiled source can be imported without having to import
my-lib/src/...Add
ts-package-configvariable to allow for removal/modification of exportsAdd a configuration option so that exports can be merged with the built package.json