Socket
Socket
Sign inDemoInstall

babel-plugin-wrap-modules-amd

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-wrap-modules-amd

A Babel plugin to wrap package modules inside AMD define() calls.


Version published
Weekly downloads
6.1K
increased by1.36%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-wrap-modules-amd

Wrap modules inside an AMD define() module.

Example

In

var console = require('console');
console.info('Say something');

Out

define(['module', 'exports', 'require', 'console'], function (module, exports, require) {
	var console = require('console');
	console.log('Say something');
});

Installation

npm install --save-dev babel-plugin-wrap-modules-amd

Usage

Add the following to your .babelrc file:

{
  "plugins": ["wrap-modules-amd"]
}

Technical Details

This plugin wraps the code inside the module with an AMD define() call. The module is not given any name and any dependencies detected by inspecting require() calls are appended to the define() dependencies array so that they can be found when require() is called.

FAQs

Package last updated on 10 Jul 2020

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