You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

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).


Version published
Weekly downloads
5.5K
decreased by-4.23%
Maintainers
14
Created
Weekly downloads
 

Readme

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc