question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`nest build` ignores tsconfig exclude option

See original GitHub issue

Bug Report

Current behavior

nest build ignores tsconfig.json’s exclude option. e.g.: I want to exclude scripts folder from compiling and this works with tsc. But when I run nest build, scripts folder is also compiled and copied to dist.

Input Code

Inside tsconfig.json:

  "exclude": ["node_modules", "dist", "uploads", "static", "scripts"]

Expected behavior

nest build should obey tsconfig excludes.

Possible Solution

Environment


Nest version: 7.0.1
 
For Tooling issues:
- Node version: 13.7.0
- Platform:  Linux 4.4

Others:
Yarn: 1.22.4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
jeffminsungkimcommented, Mar 15, 2020

Please, provide a minimal repository which reproduces your issue.

From what I’ve reproduced, it works as expected.

// tsconfig.build.json
{
  "extends": "./tsconfig.json",
  "exclude": ["node_modules", "scripts", "test", "dist", "**/*spec.ts"]
}
5reactions
umstekcommented, Jan 29, 2021

extends only extends properties in the top level, which means, the exclude array defined in tsconfig.json will be overridden by what is specified in tsconfig.build.json. You need to specify everything defined in tsconfig.json exclude plus the new ones also, in tsconfig.build.json. Hope this helps. @VFC-elindgren

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why 'exclude' option is not working in tsconfig? - Stack Overflow
First I would check node versions, yarn version etc. I successfully tried the template using yarn build node v14.7.0 yarn v1.22 ...
Read more >
Exclude a Folder from compilation with tsconfig.json in TS
Use the `exclude` option in your `tsconfig.json` file to exclude a folder from compilation in TypeScript. The `exclude` option changes what the `include` ......
Read more >
exclude - TSConfig Option - TypeScript
TypeScript in 5 minutes. An overview of building a TypeScript web app. TSConfig Options. All the configuration options for a project.
Read more >
Mark .d.ts.map files as excluded and nest them under ...
Our project uses declarationMap in tsconfig.json because it is opened with other editors that rely on TypeScript's declarationMap feature.
Read more >
API - ESBuild
Tsconfig ; Working directory. #Simple options. #Alias. Supported by: Build. This feature lets you substitute one package for another when bundling ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found