# postcss-purgecss-laravel

> postcss-purgecss wrapper with sensible defaults for Laravel apps

Latest version **2.0.0** (published 2020-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-purgecss-laravel
pnpm add postcss-purgecss-laravel
yarn add postcss-purgecss-laravel
bun add postcss-purgecss-laravel
```

## 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 | 2.0.0 |
| Published | 2020-10-08 |
| First published | 2020-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 1 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sebastian De Deyne |
| Maintainers | spatie |
| Keywords | spatie |

## Links

- npm: https://www.npmjs.com/package/postcss-purgecss-laravel
- Repository: https://github.com/spatie/postcss-purgecss-laravel
- Issues: https://github.com/spatie/postcss-purgecss-laravel/issues
- npm.io page: https://npm.io/package/postcss-purgecss-laravel

## Dependencies (1)

- [@fullhuman/postcss-purgecss](https://npm.io/package/@fullhuman/postcss-purgecss.md) ^3.0.0

## Recent versions

- 2.0.0 (latest) — 2020-10-08
- 1.0.0 — 2020-05-04
- 0.1.2 — 2020-05-04
- 0.1.1 — 2020-04-27
- 0.1.0 — 2020-04-27

## README

# `postcss-purgecss` wrapper with sensible defaults for Laravel apps

[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Latest Version on NPM](https://img.shields.io/npm/v/postcss-purgecss-laravel.svg?style=flat-square)](https://npmjs.com/package/postcss-purgecss-laravel)
[![npm](https://img.shields.io/npm/dt/postcss-purgecss-laravel.svg?style=flat-square)](https://www.npmjs.com/package/postcss-purgecss-laravel)

A simple wrapper around `postcss-purgecss` with sensible defaults for Laravel apps.

```js
// postcss.config.js

module.exports = {
    plugins: [
        require('postcss-purgecss-laravel')({
            whitelistPatterns: [/hljs/],
            extend: {
                content: [content: [path.join(__dirname, 'vendor/spatie/menu/**/*.php')],]
            },
        });
    ],
};
```

## Support us

[![Image](https://github-ads.s3.eu-central-1.amazonaws.com/postcss-purgecss-laravel.jpg)](https://spatie.be/github-ad-click/postcss-purgecss-laravel)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

## Installation

You can install the package with yarn or npm:

```bash
yarn add postcss-purgecss-laravel --dev
```

```bash
npm install postcss-purgecss-laravel --save-dev
```

## Usage

Register the PostCSS plugin.

```js
// postcss.config.js

module.exports = {
    plugins: [
        require('postcss-purgecss-laravel')(/* ... */);
    ]
}
```

All options passed to the plugin get passed down to PurgeCSS. Refer to the [PurgeCSS docs](https://purgecss.com/configuration.html#configuration-file) for an overview of the available options.

```js
// postcss.config.js

module.exports = {
    plugins: [
        require('postcss-purgecss-laravel')({
            whitelistPatterns: [/hljs/],
        }),
    ],
};
```

Options will _override_ the default options this package provides. If you'd rather _extend_ the options, place them in the `extend` option.

```js
// postcss.config.js

module.exports = {
    plugins: [
        require('postcss-purgecss-laravel')({
            extend: {
                whitelistPatterns: [/hljs/],
            },
        }),
    ],
};
```

In the above example, the `/hljs/` pattern will be _added_ to the `whitelistPatterns`, instead of overriding the default `whitelistPatterns` option.

These are the defaults this package provides:

```js
const defaultConfig = {
    content: [
        "app/**/*.php",
        "resources/**/*.html",
        "resources/**/*.js",
        "resources/**/*.jsx",
        "resources/**/*.ts",
        "resources/**/*.tsx",
        "resources/**/*.php",
        "resources/**/*.vue",
        "resources/**/*.twig",
    ],
    defaultExtractor: (content) => content.match(/[\w-/.:]+(?<!:)/g) || [],
    whitelistPatterns: [/-active$/, /-enter$/, /-leave-to$/, /show$/],
};
```

### Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker.

## Credits

- [Sebastian De Deyne](https://github.com/sebastiandedeyne)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

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