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.

Emits '../' for node_modules and subfolder tsconfig

See original GitHub issue

tsconfig.base.json compilerOptions:

"paths": {
"vue": ["https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"]
}

subfolder/tsconfig.json:

"extends": "../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"plugins": [{ "transform": "typescript-transform-paths" }]
}

ttsc generated module file: import Vue from "../https:/cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js";

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
viT-1commented, Jun 3, 2021

@nonara I agree. I’ve found transformer with functionality of interest.

1reaction
nonaracommented, Jun 3, 2021

@viT-1 Thanks for the suggestion! I believe that functionality goes a bit beyond the scope of what we’re doing, however.

Our aim with this plugin is to rewrite imports using the tsconfig.json paths configuration. We rely on the TS compiler API to hand off that resolution to the typescript compiler to ensure that we’re in sync.

We have gone a little beyond that directive by providing for single comment resolution overrides, but a change like you’re suggesting would require rewriting or splitting the resolution engine, which would come with many side effects. It would also potentially get confusing if there are intersecting resolution paths between tsconfig and importmap, etc.

If there is a broad enough interest in adding support in the future, we can revisit this, but for now, I think we’ll stick with our current path.

You’re welcome to fork the repository and use it as a basis that suits your needs, however!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TSConfig Reference - Docs on every TSConfig option
Compiler Options. These options make up the bulk of TypeScript's configuration and it covers how the language should work. Type Checking; Modules; Emit...
Read more >
Publishing Node modules with TypeScript and ES modules
We can do this by making two tsconfig. json files, one that targets ES modules and another for CommonJS.
Read more >
What it means **/node_modules/* in tsconfig.json?
It's to exclude any node_modules sub-folders (at any depth) of the stuff in the root level node_modules folder.
Read more >
Understanding TypeScript Configuration Options
This post will walk you through how tsconfig.json works in your ... If you want to specify the module that should be included...
Read more >
Configuring TypeScript compiler - inDepthDev
tsconfig.json can be created by the compiler automatically using init flag: ... Using the default configuration, the compiler only emits .js files.
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