# var-library-alias-webpack-plugin

> Adds alias to var library built by webpack

Latest version **1.0.1** (published 2021-01-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install var-library-alias-webpack-plugin
pnpm add var-library-alias-webpack-plugin
yarn add var-library-alias-webpack-plugin
bun add var-library-alias-webpack-plugin
```

## 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.1 |
| Published | 2021-01-07 |
| First published | 2021-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 12 |
| Dependencies | 0 |
| Unpacked size | 14.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | sobolew |
| Maintainers | sobolew |

## Links

- npm: https://www.npmjs.com/package/var-library-alias-webpack-plugin
- Repository: https://github.com/sobolew/var-library-alias-webpack-plugin
- Homepage: https://github.com/sobolew/var-library-alias-webpack-plugin#readme
- Issues: https://github.com/sobolew/var-library-alias-webpack-plugin/issues
- npm.io page: https://npm.io/package/var-library-alias-webpack-plugin

## Recent versions

- 1.0.1 (latest) — 2021-01-07
- 1.0.0 — 2021-01-07

## README

# var-library-alias-webpack-plugin

Webpack plugin to create an alias for var library builds. Works both with webpack 5 and webpack 4.

## Install

`npm install --saved-dev var-library-alias-webpack-plugin`
or
`yarn add --dev var-library-alias-webpack-plugin`

## Usage

1. Require plugin at the top of your webpack.config.js

```const VarLibraryAliasWebpackPlugin = require('var-library-alias-webpack-plugin');```

2. Add a plugin to plugins array

```
module.exports = {
  output: {
    ...
    libraryTarget: 'var',
    library: 'MyLib',
  },
  ...
  plugins: [
    new VarLibraryAliasWebpackPlugin({
      alias: 'MyLibAlias',
    }),
  ...
}
```

Following config will result in this code

```var MyLib=function(e){ ...WEBPACK GENERATED CODE... }();var MyLibAlias=MyLib;```

## Options

`alias` - name of the library alias

---
_Source: https://npm.io/package/var-library-alias-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
