Skip to content

aleclarson/metro-tsconfig-paths

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metro-tsconfig-paths

Load tsconfig.json modules from locally developed packages, and help Metro resolve imports using their paths objects.

Usage

Add the following to your metro.config.js module:

const withTSConfig = require('metro-tsconfig-paths')

module.exports = withTSConfig({
  /* Metro configuration goes here */
})

How it works

It uses get-dev-paths to find any locally developed packages. Then it uses tsconfig-paths to load tsconfig.json modules and convert their paths objects into "matcher functions". Then it hooks into your Metro config and applies the relevant matcher function (if any) to whichever dependency is being resolved.

About

Use tsconfig 'paths' with Metro

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published