You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.1 KiB
Markdown

# postcss-icss-find-imports
A PostCSS plugin for finding import statements in CSS that follows the ICSS specification, __but not removing them from the AST__, eg. for implementing dependency discovery.
This code was adapted from [css-loader](https://github.com/webpack-contrib/css-loader) and modified to work as a stand-alone plugin.
This documentation is rudimentary and will probably be improved at some point. Feel free to open an issue if something is unclear!
## License
```
This module is derived from: css-loader (https://github.com/webpack-contrib/css-loader)
(c) JS Foundation and other contributors
Modifications by:
(c) 2019, Sven Slootweg <admin@cryto.net>
Licensed under:
MIT (https://opensource.org/licenses/MIT)
```
## API
Exports a plugin that is compatible with PostCSS 8.
Takes no options upon initialization.
When applied, it will find import statements in the code, exposing them as the following types of `messages` (from plugin `postcss-icss-parser`):
- `import`: an import statement.
- `url`: The path/URL being imported from.
The import statements __are not removed__ from the AST.