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.

Feature request: Support for wildcards "@module-name/*": "./modules/*"

See original GitHub issue

Feature request

Instead of writing

"_moduleAliases": {
  "@module-name/moduleA": "./modules/moduleA",
  "@module-name/moduleB": "./modules/moduleB",
  "@module-name/moduleC": "./modules/moduleC",
}

it would be handy to just write:

"_moduleAliases": {
  "@module-name/*": "./modules/*"
}

@ilearnio Or is it possible to achieve this with a custom handler function?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

2reactions
flolucommented, Sep 9, 2020

@davestewart Thanks for the tip! I’ve already got it working by using tsconfig-paths

Instead of running

ts-node file

I just run

ts-node -r tsconfig-paths/register file

It will automatically pick up the paths from tsconfig.json

@ilearnio @Kehrlann Should this issue be closed now?

1reaction
Kehrlanncommented, Apr 1, 2020

Oooh. This is a more complicated project, with ts-node… Can’t get it to work here, running npx ts-node services/users and such. I might take a look tomorrow but can’t promise anything.

Simple project: https://github.com/kehrlann/module-alias-library`. It shows multiple things, but I just added an alias “wildcard” showing exactly what you mention. Run it with node index.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module declaration wildcards #5101 - facebook/flow - GitHub
While stubbing out most modules is easy to do by just doing: declare module 'module-name' { declare module.exports: any; } Some modules ......
Read more >
latest - Environment Modules
pattern may contain wildcard characters. Multiple versions of an application can be supported by creating a subdirectory for the application containing ...
Read more >
Example of Modules, Tasks and Elements
Listed below is an example of a Project with two modules. In the first module, named "Main", it performs four different tasks. The...
Read more >
GN Reference - Google Git
This page is automatically generated from gn help --markdown all . ... the module name of target under compilation (see "module_name" variable).
Read more >
Feature Request: Allow wildcards in Windows Event Log input
Currently I know of no way (that I can find) to specify in the input to collect all event logs using wildcards in...
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