# autoprefixer-loader

> [deprecated] Autoprefixer loader for webpack

Latest version **3.2.0** (published 2016-01-18) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2016-01-18 |
| First published | 2014-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 216 |
| Author | Pascal Hartig |
| Maintainers | passy, ai |
| Keywords | webpack, loader, autoprefixer |

## Links

- npm: https://www.npmjs.com/package/autoprefixer-loader
- Repository: https://github.com/passy/autoprefixer-loader
- Homepage: https://github.com/passy/autoprefixer-loader#readme
- Issues: https://github.com/passy/autoprefixer-loader/issues
- npm.io page: https://npm.io/package/autoprefixer-loader

## Dependencies (4)

- [postcss](https://npm.io/package/postcss.md) ^5.0.4
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^6.0.2
- [loader-utils](https://npm.io/package/loader-utils.md) ^0.2.11
- [postcss-safe-parser](https://npm.io/package/postcss-safe-parser.md) ^1.0.1

## 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

- 3.2.0 (latest) — 2016-01-18
- 3.1.0 — 2015-09-08
- 3.0.0 — 2015-09-07
- 2.1.0 — 2015-09-02
- 2.0.0 — 2015-05-30
- 2.0.0-beta.0 — 2015-05-30
- 1.2.0 — 2015-03-01
- 1.1.0 — 2015-01-21
- 1.0.0 — 2014-08-27
- 0.1.1 — 2014-02-22
- 0.1.0 — 2014-02-22

## README

# autoprefixer-loader [![Build Status](https://travis-ci.org/passy/autoprefixer-loader.svg?branch=master)](https://travis-ci.org/passy/autoprefixer-loader) [![Dependency Status](https://gemnasium.com/passy/autoprefixer-loader.png)](https://gemnasium.com/passy/autoprefixer-loader) [![Code Climate](https://codeclimate.com/github/passy/autoprefixer-loader.png)](https://codeclimate.com/github/passy/autoprefixer-loader)

An [autoprefixer](https://github.com/ai/autoprefixer) loader for [webpack](https://github.com/webpack/webpack).

> ### :warning: This module is deprecated. [Autoprefixer official page](https://github.com/postcss/autoprefixer#webpack) recommends using [`postcss-loader`](https://github.com/postcss/postcss-loader) instead.

## Usage

```js
var css = require('!raw!autoprefixer!./file.css'); // Just the CSS
var css = require('!css!autoprefixer!./file.css'); // CSS with processed url(...)s
```

See [css-loader](https://github.com/webpack/css-loader) to see the effect of processed `url(...)`s.

Or within the webpack config:

```js
module: {
  loaders: [{
    test: /\.css$/,
    loader: 'css-loader!autoprefixer-loader?browsers=last 2 versions'
  }]
}
```

Then you can: `var css = require('./file.css');`.

Use in tandem with the [style-loader](https://github.com/webpack/style-loader) to add the css rules to your `document`:

```js
module: {
  loaders: [{
    test: /\.css/,
    loader: 'style-loader!css-loader!autoprefixer-loader'
  }]
}
```

and then `require('./file.css');` will compile and add the CSS to your page.

## Options

### `browsers`

Specify a single browser to support. [Read
  more](https://github.com/postcss/autoprefixer#browsers)

```js
loaders: [{
  loader: 'css-loader!autoprefixer-loader?browsers=last 2 version',
  ...
}]
```

For a list of browsers use JSON syntax.
```js
loaders: [{
  loader: 'css-loader!autoprefixer-loader?{browsers:["last 2 version", "Firefox 15"]}',
  ...
}]
```

### `cascade`

*Default: true*

When disabled, autoprefixer creates no visual cascade for the generated
prefixes.
[Read more](https://github.com/postcss/autoprefixer#visual-cascade)

```js
loaders: [{
  loader: 'css-loader!autoprefixer-loader?cascade=false',
  ...
}]
```

### `safe`

*Default: false*

When enabled, autoprefixer will attempt to parse invalid CSS. [Read
more](https://github.com/postcss/autoprefixer-core#safe-mode)

```js
loaders: [{
  loader: 'css-loader!autoprefixer-loader?safe=true',
  ...
}]
```

### `add`

*Default: true*

While disabled, autoprefixer will not add any new prefixes to your code. [Read
more](https://github.com/postcss/autoprefixer#usage)

```js
loaders: [{
  loader: 'css-loader!autoprefixer-loader?add=false',
  ...
}]
```

### `remove`

*Default: true*

Whether or not autoprefixer should automatically remove outdated prefixes. [Read
more](https://github.com/postcss/autoprefixer#usage)

```js
loaders: [{
  loader: 'css-loader!autoprefixer-loader?remove=false',
  ...
}]
```

## Install

`npm install autoprefixer-loader --save-dev`

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style.

## Release History
* 3.1.0 - Upgrade dependencies, move to autoprefixer (no longer -core)
* 3.0.0 - Upgrade to autoprefixer-core 6.0
* 2.1.0 - Add `add`, `remove` options, bump autoprefixer-core
* 2.0.0 - Updated autoprefixer + postcss
* 1.2.0 - Added support for existing sourcemaps from earlier in the chain
* 0.1.0 - Initial release

## License
Licensed under the MIT license.

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