Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-esm-resolver

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-esm-resolver

A Babel plugin for resolving ESM import and export paths

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
45
decreased by-73.21%
Maintainers
0
Weekly downloads
 
Created
Source

Babel Plugin: ESM Resolver

A Babel plugin for resolving ESM import and export paths

npm node

size downloads

Build Status

Overview

Resolves ESM import and export paths to other source modules with extensions, optionally replacing the extension with a different one (including imports with extensions, like native ESM and Deno-style TypeScript). This is useful because most environments will not perform automatic file extension resolution.

Since it resolves the statements before the modules are transpiled, it can also be used to resolve the paths for other transpiled module loaders.

Must be configured to work properly, it will not do anything by default.

There are three classes of resolver that can be enabled (source, module, submodule) depending on the modules that need to be resolved. Module support for ESM has improved so only source is likely to be needed.

Usage

Options

  • source Source modules: import foo from './bar'
  • module Module main entry points: import foo from 'bar'
  • submodule Module submodules: import foo from 'bar/foo'

NOTE: The module and submodule options are generally no longer needed now that conditional exports are available.

Bugs

If you find a bug or have compatibility issues, please open a ticket under issues section for this repository.

License

Copyright (c) 2019-2024 Alexander O'Mara

Licensed under the Mozilla Public License, v. 2.0.

If this license does not work for you, feel free to contact me.

Keywords

FAQs

Package last updated on 03 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc