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.

Question: What is the point of the `typescript` option?

See original GitHub issue

This says that if the option isn’t set, the plugin will automatically set it to require('typescript').

https://github.com/ezolenko/rollup-plugin-typescript2/blob/5ce7676ad0451df81e61190d42694f97085111fc/src/index.ts#L72-L74

I’m wondering why you would ever want to manually set the typescript option to require('typescript') then. Wouldn’t calling require('typescript') in rollup.config.js always give the same answer as require('typescript') in the plugin?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ezolenkocommented, Nov 25, 2020

You might want to use multiple versions of typescript for example, or have it in a non-standard place.

0reactions
agilgur5commented, Apr 24, 2022

You can also use this for alternative TS implementations, such as ttypescript, for instance for the purpose of #201 or something else.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the question mark for in a Typescript parameter name
Not exactly. Question mark means "optional". So it's a shorthand for "parameter: type | undefined = undefined".. – mcoolive.
Read more >
Documentation - TypeScript 3.7
Ultimately the goal of TypeScript is to type existing JavaScript constructs in the least disruptive way. For that reason, TypeScript 3.7 introduces a...
Read more >
How to use a question mark in TypeScript variables
The question mark ? in typescript is used in two ways: To mention that a particular variable is optional. To pre-check if a...
Read more >
Top 50 TypeScript Interview Questions and Answers in 2023
A TypeScript code is written in a file with .ts extension and then compiled into JavaScript using the compiler. You can write the...
Read more >
Complete Guide to TypeScript Question Mark - eduCBA
TypeScript question mark are used on variables to mark it as an optional parameter. When declaring a TypeScript variable, the declared variable becomes...
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