# amdcheck-loader

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

Latest version **1.0.4** (published 2015-09-28) · 0 weekly downloads

## Install

```sh
npm install amdcheck-loader
pnpm add amdcheck-loader
yarn add amdcheck-loader
bun add amdcheck-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2015-09-28 |
| First published | 2015-09-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Mehdi Shojaei |
| Maintainers | mehdishojaei |
| Keywords | gruntplugin, optimize, AMD, dependency, unused, useless, requirejs |

## Links

- npm: https://www.npmjs.com/package/amdcheck-loader
- Repository: https://github.com/mehdishojaei/amdcheck-loader
- Issues: https://github.com/mehdishojaei/amdcheck-loader/issues
- npm.io page: https://npm.io/package/amdcheck-loader

## Dependencies (1)

- [amdextract](https://npm.io/package/amdextract.md) ^2.0.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2015-09-28
- 1.0.3 — 2015-09-27
- 1.0.2 — 2015-09-27
- 1.0.1 — 2015-09-27
- 1.0.0 — 2015-09-27

## README

# amdcheck loader for webpack

> Uses AST to find and remove unused dependencies in AMD modules.

## Installation

`npm install amdcheck-loader`

## Usage

source.js
```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

``` javascript
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)

---
_Source: https://npm.io/package/amdcheck-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
