Comments (1)
Thanks for reporting this!
This is the expected behavior for TypeScript with your setup. The my-app
project depends on the source code of products
and when you run tsc -p apps/my-app/tsconfig.app.json
, the TS compiler creates a ts.Program
for that configuration file. It doesn't use any other configuration file unless is extended or referenced. In this case, it extends the tsconfig.base.json
and it doesn't reference any other configuration file. Therefore, every file included in the ts.Program
will be processed with the apps/my-app/tsconfig.app.json
configuration (plus the merged config from the extended tsconfig.base.json
). The library source code is part of the ts.Program
because:
- the
ts.Program
rootDir
is the root of the workspace (specified intsconfig.base.json
) - it's imported from the application using the path mapping
@nx-test/products
which is configured to resolvelibs/products/src/index.ts
(a file inside therootDir
)
So, that's why tsc
is processing libs/products/src/lib/products.tsx
when running for the apps/my-app/tsconfig.app.json
project. Please note that, as mentioned, this is expected TypeScript behavior based on the configuration you shared in the reproduction.
TypeScript has a way to effectively split source code into multiple "projects", which is using project references and tsc -b
. By configuring your whole TypeScript setup like a solution where each tsconfig.json
file is considered and independent project, tsc
can build them independently. An issue with it is that tsc -b
is a "build"-only command. You'll always need to at least emit the declaration files.
from nx.
Related Issues (20)
- ^19.7.4 command nx run app:test --watch --ui causes task to fail on test failure
- Generated package-lock.json is invalid
- Cache hits when it shouldn't
- How to use preserveLocalDependencyProtocols in nx 19.8.0? HOT 6
- Application bootstrapping breaks migrating from 19.4 to 19.5
- @nx/expo executor install failing. yarn v4, Unknown Syntax Error: Unsupported option name ("--force"). HOT 1
- Atomized groups have always suffix `E2E (CI)`. This should be toggleable
- @storybook/angular:build-storybook stats-json not found in schema HOT 1
- v19.8.0 - new project - Expected an assignment or function call and instead saw an expression
- v19.8.0 create-nx-workspace generate a non working environment - npm i in generated project crashes HOT 5
- NX v19.8.0 - npm install could not resolve dependency after converting workspace from .eslintrc.json to flat config HOT 1
- Playwright --last-failed CLI flag not supported (1.44+)
- Yarn pnp vs @nx/cypress
- [Fixed] Yarn installation fails with nodeLinker: node_modules HOT 3
- Can't run any target (task) HOT 3
- Angular NGRX store not registered with new repository HOT 1
- Issue with Web Worker and Module Federation in Angular NX Project HOT 2
- Cannot Exclude Applications from Versioning and Release Process While Updating Dependencies with nx release
- @nx/expo:build for eas local is failing with yarn v4. Unknown error. See logs of the Install dependencies build phase for more information.
- Cannot find project 'web' HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nx.