# postcss-import-ext-glob

> A PostCSS plugin to extend postcss-import path resolver to allow glob usage as path

Latest version **2.1.1** (published 2022-11-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-import-ext-glob
pnpm add postcss-import-ext-glob
yarn add postcss-import-ext-glob
bun add postcss-import-ext-glob
```

## 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.1.1 |
| Published | 2022-11-30 |
| First published | 2018-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 13.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Author | Dimitri NICOLAS |
| Maintainers | dimitrinicolas |
| Keywords | front-end, postcss, import, extension, glob, postcss-plugin |

## Links

- npm: https://www.npmjs.com/package/postcss-import-ext-glob
- Repository: https://github.com/dimitrinicolas/postcss-import-ext-glob
- Issues: https://github.com/dimitrinicolas/postcss-import-ext-glob/issues
- npm.io page: https://npm.io/package/postcss-import-ext-glob

## Dependencies (3)

- [fast-glob](https://npm.io/package/fast-glob.md) ^3.2.12
- [fast-sort](https://npm.io/package/fast-sort.md) ^3.2.0
- [postcss-value-parser](https://npm.io/package/postcss-value-parser.md) ^4.2.0

## Recent versions

- 2.1.1 (latest) — 2022-11-30
- 2.1.0 — 2022-11-30
- 2.0.1 — 2021-01-30
- 2.0.0 — 2021-01-02
- 1.1.0 — 2018-08-14
- 1.0.0 — 2018-08-13

## README

# postcss-import-ext-glob [![Build Status][travis badge]][travis link] [![Coverage Status][coveralls badge]][coveralls link]

A [PostCSS][postcss] v8 plugin to extend [postcss-import][postcss-import] path
resolver to allow [glob][glob ref] usage as a path.

You must use this plugin along with [postcss-import][postcss-import], place
this plugin **before** `postcss-import`.

```pcss
@import-glob "components/**/*.css";
```

## Installation

```console
$ npm install --save-dev postcss postcss-import postcss-import-ext-glob
```

## Usage

```js
// PostCSS plugins
postcss([
  require('postcss-import-ext-glob'),
  require('postcss-import')
]);
```

Check out [PostCSS](https://github.com/postcss/postcss) docs for the complete
installation.

### Example

This plugin transform this:

```pcss
@import-glob "components/**/*.css";
```

into this:

```pcss
@import "components/form/input.css";
@import "components/form/submit.css";
/* etc */
```

Thereby, the plugin `postcss-import` can now import each file.

You can pass multiple globs in one:

```pcss
@import-glob "helpers/**/*.css", "components/**/*.css";
```

## Options

You can pass a `sort` option to this plugin with a value of "asc" or "desc":

```js
// Postcss plugins
postcss([
  require('postcss-import-ext-glob')({
    sort: 'desc'
  }),
  require('postcss-import')
]);
```

The sort order is by default ascending.

## Related

- [postcss-import][postcss-import] - PostCSS plugin to inline @import rules
content
- [fast-glob][fast-glob] - Module used for getting glob entries
- [fast-sort][fast-sort] - Module used for sorting glob entries
- [ava-postcss-tester][ava-postcss-tester] - Simply test your PostCSS plugin 
with AVA

## License

This project is licensed under the [MIT license](LICENSE).

[travis badge]: https://travis-ci.org/dimitrinicolas/postcss-import-ext-glob.svg?branch=master
[travis link]: https://travis-ci.org/dimitrinicolas/postcss-import-ext-glob
[coveralls badge]: https://coveralls.io/repos/github/dimitrinicolas/postcss-import-ext-glob/badge.svg?branch=master
[coveralls link]: https://coveralls.io/github/dimitrinicolas/postcss-import-ext-glob?branch=master

[postcss]: https://github.com/postcss/postcss
[postcss-import]: https://github.com/postcss/postcss-import
[fast-glob]: https://www.npmjs.com/package/fast-glob
[fast-sort]: https://www.npmjs.com/package/fast-sort
[ava-postcss-tester]: https://github.com/dimitrinicolas/ava-postcss-tester

[glob ref]: https://en.wikipedia.org/wiki/Glob_(programming)

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