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.

Add support for project references

See original GitHub issue

What happens and why it is wrong

Since typescript 3.0, typescript has added support for project references. tsc -b now build all projects listed in references section of the main tsconfig before the main project is built. See typescript documentation for project references.

When using rollup-plugin-typescript2, the references projects are not being build at all. It only builds the current project.

Environment

Versions

  • typescript: 3.2.2
  • rollup: 1.1.2
  • rollup-plugin-typescript2: 0.19.2

rollup.config.js

Not relevant

tsconfig.json

Main project:

{
  "compilerOptions": {
    "target": "es6",
    "module": "es2015", 
    "lib": [
      "es2015",
      "dom"
    ],
},
  "references": [
    {
      "path": "./common"
    }
  ]
}

Common project

{
  "compilerOptions": {
    /* Basic Options */
    "target": "es5",
    "module": "es2015",
    "declaration": true,
    "declarationMap": false,
    "outDir": "dist",
    "rootDir": ".",
    "composite": true,
    "strict": true, 
     "moduleResolution": "node", 
    "esModuleInterop": true
  },
  "references": []  // * Any project that is referenced must itself have a `references` array (which may be empty).
}

package.json

Not relevant

plugin output with verbosity 3

Not relevant

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
dtassonecommented, May 27, 2022

Partial support is in 0.20.0 now.

What does it mean partial? I’m trying to use this feature in a monorepo and I don’t get my referenced package rebuilt when I add the option in the plugin conf or in my tsconfig…

    typescript({ build: true }),
...
  "compilerOptions": {
    "declaration": true,
    "declarationDir": "./dist",
    "module": "es6",
    "noImplicitAny": true,
    "strict": true,
    "outDir": "./dist",
    "target": "es6",
    "sourceMap": true,
    "build": true
  },

Composite flag is on in my referenced package and running tsc --build works as expected

Am I missing something?

0reactions
ezolenkocommented, May 8, 2022

Partial support is in 0.20.0 now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add references in the Reference Manager - Visual Studio ...
In Solution Explorer, right-click the References or Dependencies node, and then choose either Add Project Reference, Add Shared Project ...
Read more >
Documentation - Project References - TypeScript
Project references are a new feature in TypeScript 3.0 that allow you to structure your TypeScript ... We've also added support for declaration...
Read more >
Adding and removing the project references for a user ... - IBM
To add or remove project references: In the Pattern Authoring editor, click the Source Files tab. Click Change Project References. To add a...
Read more >
Add support for cross project references for labels - GitLab.org
Rationale · Cross project label references are currently not supported in GitLab · to_reference method signature in Label model breaks the abstraction introduced ......
Read more >
Use project references - Palantir
Project references add an increased layer of scrutiny for moving data between Projects by explicitly acknowledging when a dataset is exported from or ......
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