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

babel-plugin-normalize-requires

Package Overview
Dependencies
Maintainers
14
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-normalize-requires

A Babel plugin that rewrites require() calls to normalize them (removing extensions and trailing slashes, for example).

  • 2.32.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
14
Created
Source

babel-plugin-normalize-requires

Normalize AMD require() calls.

Example

In

require('./a-module.js');

Out

require('./a-module');

Installation

npm install --save-dev babel-plugin-normalize-requires

Usage

Add the following to your .babelrc file:

{
	"plugins": ["normalize-requires"]
}

Technical Details

This plugin removes .js and / suffixes from module names used in AMD require() calls.

However, the plugin is smart enough to not remove .js suffixes when they are part of the npm package name (as opposed to module name).

FAQs

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

  • 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