[DRAFT / DISCUSSION] Intra-package dependencies (between entry points)
See original GitHub issueType of Issue
[ ] Bug Report
[x] Feature Request
Description
I wonder how to handle the dependencies here. I have a
@org/components
root package, and I would like to have@org/components/shared
for shared utilities and stuff. The root package can import stuff from shared without generating duplicated compile code? Is there a way to set up this kind of “dependency”?
Motivation
Allow dependencies between entry points of the same package.
Expected Behaviour
By TypeScript AST Traversal, detect whether @org/components
depends on another entry point within the same package, e.g. @org/components/shared
.
Then create a build graph, i.e. @org/components/shared
is required to be built before @org/components
.
Then, we run the transformation process for packages w/o inter-entry-point deps first. When running the transformation process for dependent packages, configure tsc compilerOptions.paths
to point to a FESM bundle of its dependency.
Version Information
ng-packagr: 2.0.0-rc.x
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:6 (4 by maintainers)
Top GitHub Comments
So I started a first draft in #419. Ideas and thoughts?
From my point of view, if you have have something that can be shared/re-used I’d say create a separate package rather than a separate entry point. But that’s just my opinion.
And yeah with
compilerOptions.paths
it is possible to be done, I am doing something similar for a mono-repo