Socket
Socket
Sign inDemoInstall

babel-plugin-wrap-modules-amd

Package Overview
Dependencies
178
Maintainers
15
Versions
120
Alerts
File Explorer

Advanced tools

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.6K
decreased by-12.59%
Maintainers
15
Created
Weekly downloads
 

Readme

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

Last updated on 24 Jan 2022

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