Socket
Socket
Sign inDemoInstall

babel-plugin-normalize-requires

Package Overview
Dependencies
Maintainers
1
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
6K
increased by1.52%
Maintainers
1
Weekly downloads
 
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 24 Apr 2018

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