TypeStrong / TypeStrong/ts-loader

projectReferences does not build with the specified tsconfig

Open
#1,632 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.5k
Forks
439
Avg merge
17h 17m
Merged PRs (30d)
2

Description

Expected Behaviour

ts-loader should build the dependent projects using the tsconfig specified in the references field.

Actual Behaviour

It seems like it is just building the dependent projects by using the tsconfig.json.

Steps to Reproduce the Problem

e.g:

- packages
  - app-1
  - pkg-a

/packages/app-1/tsconfig.json:

{
  "references: [{
    "path": "../pkg-a/tsconfig.build.json"
  }]
}

/packages/pkg-a/tsconfig.build.json:

{
  /* some config */
}

/packages/pkg-a/tsconfig.json:

{
  "compilerOptions": {
    "verbatimModuleSyntax": true
  }
}

When building app-1, I got Unknown compiler option 'verbatimModuleSyntx.

So it seems like ts-loader is using the tsconfig.json even though the references point to pkg-a/tsconfig.build.json

I want to use verbatimModuleSyntax in tsconfig.json to tighten type checking and IDE support.
But ts-loader does not recognize it and with this issue, I don't have a way to exclude it.

Location of a Minimal Repository that Demonstrates the Issue.

No repro yet. This happens on some private project atm.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the packages/app-1 and packages/pkg-a project-reference layout described in the report, since no minimal repository is provided. Trace how ts-loader resolves the references entry and selects tsconfig.json versus tsconfig.build.json. Done means dependent projects are built with the explicitly referenced tsconfig and the reported compiler-option behavior is covered by a reproducible test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.