Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amdcheck-loader

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amdcheck-loader

Webpack loader that uses AST to find and remove unused dependencies in AMD modules.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

amdcheck loader for webpack

Uses AST to find and remove unused dependencies in AMD modules.

Installation

npm install amdcheck-loader

Usage

source.js

define('module1', ['p1', 'p2'], function (a, b) {
	/**
	 * b is not used in this scope.
	 */
    return (function(b) {
      return b;
    })(a);
});

define('module2', ['p1', 'p2', 'p3', 'p4'], function (a, b, c) {
	return b;
});

example.js

var output = require("amdcheck!./source.js");
// => returns optimized source (unused dependencies removed).

console.log(output);

output

define('module1', ['p1'], function (a) {
	/**
	 * b is not used in this scope.
	 */
    return (function(b) {
      return b;
    })(a);
});

define('module2', ['p2'], function (b) {
	return b;
});

Don't forget to polyfill require if you want to use it in node. See webpack documentation.

License

MIT (http://www.opensource.org/licenses/mit-license.php)

Keywords

FAQs

Package last updated on 28 Sep 2015

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