# annotation-loader

> webpack annotation loader

Latest version **0.0.2** (published 2015-04-05) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2015-04-05 |
| First published | 2015-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dmitry Makhnev |
| Maintainers | dmitrymakhnev |
| Keywords | annotation-loader, webpack loader, loader, annotation |

## Links

- npm: https://www.npmjs.com/package/annotation-loader
- Repository: git@github.com:DmitryMakhnev/annotation-loader
- Homepage: https://github.com/DmitryMakhnev/annotation-loader
- Issues: https://github.com/DmitryMakhnev/annotation-loader/issues
- npm.io page: https://npm.io/package/annotation-loader

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2015-04-05
- 0.0.1 — 2015-04-05

## README

#annotation-loader

webpack annotation loader

## Installation

``` sh
npm install --save-dev annotation-loader
```

## Usage

for test.js 

``` javascript

var foo = {};

/*@bar*/
console.log('bar');
/*@/bar*/

var bar = {};

/*@bar2*/
console.log('bar2');
/*@/bar2*/

```

with config 

``` javascript

var webpack = require('webpack');

module.exports = {
    entry:  './entry.js',
    output: {
        path: __dirname,
        filename: 'bundle.js'
    },
    module: {
        loaders: [
            {
                test: /^.*$/,
                loader: "annotation",
                annotations: [
                    {
                        'for': 'bar',
                        'do': ''
                    },
                    {
                        'for': 'bar2',
                        'do': function (str, $1) {
                            //$1 is content of annotation 
                            return '//annotation removed';
                        }
                    }
                ]
            }
        ]
    }
};
```

you get

``` javascript

var foo = {};

var bar = {};

//annotation removed

```


## Use for

Use to remove tests exports or some code for dev mode in production


##Licence

MIT

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