Socket
Book a DemoInstallSign in
Socket

rollup-plugin-import-meta-resolve

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-import-meta-resolve

Another Rollup resolver plugin

0.3.1
latest
Source
npmnpm
Version published
Weekly downloads
2
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

rollup-plugin-import-meta-resolve

A resolver plugin using the import.meta.resolve algorithm provided by Node.js.

This plugin is (more-or-less) a drop-in replacement for the @rollup/plugin-node-resolve plugin.

There are a few differences between this plugin and the Node.js resolver:

  • We allow importing modules without an extension. This is a common practice in Node.js, but it is not allowed in ESM. We allow it here to maintain compatibility with a large number of modules.
  • We allow importing directories. This is not allowed in ESM, but it is common in Node.js. We allow it here to maintain compatibility with a large number of modules.
  • We only allow import conditions. This is to ensure that ESM-modules are consumed first. This doesn't imply that CommonJS modules are not consumed as default conditions and packages without export conditions may still resolve to a CommonJS module.

You can use strict to disable (1) and (2) (which is recommended), but you may need to fix some modules that are not compliant with the ESM spec.

This plugin is restrictive by default (e.g. no module roots, no require exports, etc.). This ensures projects are up-to-date and compliant across the board. If you have custom file tree requirements, it's recommended to use symlinked directories.

Keywords

node

FAQs

Package last updated on 15 Mar 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.