Package Exports
- postcss-import-ext-glob
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (postcss-import-ext-glob) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
postcss-import-ext-glob

A PostCSS plugin to extend postcss-import path resolver to allow glob usage as path.
You must use this plugin along with postcss-import, place this
plugin before postcss-import.
@import-glob "components/**/*.css";Installation
$ npm install postcss-import-ext-globUsage
// Postcss plugins
postcss([
require('postcss-import-ext-glob'),
require('postcss-import')
]);Check out PostCSS docs for the complete installation.
Example
This plugin transform this:
@import-glob "components/**/*.css";into this:
@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:
@import-glob "helpers/**/*.css", "components/**/*.css";Options
You can pass a sort option to this plugin with a value of "asc" or "desc":
// Postcss plugins
postcss([
require('postcss-import-ext-glob')({
sort: 'desc'
}),
require('postcss-import')
]);The sort order is by default ascending.
Related
- postcss-import - PostCSS plugin to inline @import rules content
- fast-glob - Module used for getting glob entries
- fast-sort - Module used for sorting glob entries
License
This project is licensed under the MIT license.