JSPM

babel-plugin-config-module-resolver

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 531
  • Score
    100M100P100Q99118F
  • License CC0-1.0

A babel plugin that resolves modules using the tsconfig.json or jsconfig.json configuration

Package Exports

  • babel-plugin-config-module-resolver

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-plugin-config-module-resolver) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

babel-plugin-config-module-resolver

npm version build status issue tracker pull requests

babel-plugin-config-module-resolver is a Babel plugin that resolves modules using the tsconfig.json or jsconfig.json configuration.

It is a light wrapper around babel-plugin-module-resolver.

Installation

Add babel-plugin-config-module-resolver to your project:

npm install babel-plugin-config-module-resolver --save-dev

Usage

Add babel-plugin-config-module-resolver to your babel configuration:

// babel.config.js
{
  "plugin": ["config-module-resolver"]
}
// tsconfig.json or jsconfig.json
{
  "compilerOptions": {
    "baseUrl": "src",
    "paths": {
      "@com/*": ["components/*"],
      "@css/*": ["components/*.module.css"]
    }
  }
}
// App.js (before)
import Button from '@com/Button';
import ButtonStyle from '@css/Button';

// App.js (after)
import Button from '/path/to/src/components/Button';
import ButtonStyle from '/path/to/src/components/Button.module.css';