Socket
Socket
Sign inDemoInstall

babel-plugin-normalize-requires

Package Overview
Dependencies
178
Maintainers
14
Versions
120
Alerts
File Explorer

Advanced tools

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
6.7K
decreased by-12.06%
Maintainers
14
Install size
8.26 MB
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

Last updated on 05 Mar 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc