Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

postcss-easy-import

TrySound58.6kMIT4.0.0

PostCSS plugin to inline @import rules content with extra features

postcss, css, postcss-plugin, import, glob, partial

readme

postcss-easy-import Build Status

PostCSS plugin to inline @import rules content with extra features.

Usage

postcss([ require('postcss-easy-import') ])

See PostCSS docs for examples for your environment.

Resolving files with globs

The path to the file will be checked and if it contains a glob it will be used to locate it. These can be mixed and matched with normal module paths:

@import "suitcss-utils-display"; /* node_modules */
@import "./theme.css"; /* relative path */
@import "./components/*.css"; /* glob */
@import "suitcss-utils-size/lib/*.css"; /* glob inside node_modules */

Options

This plugin is a postcss-import extension which introduces its own resolve option.

prefix

Type: false or string Default: false

Allows partial-like importing with a prefix before the filename.

@import 'modules/partial.css';
/* will import modules/_partial.css */

Prefixed versions are always favoured. Otherwise the non-prefix version is used:

├── _baz.css
├── baz.css
├── bar.css

The matched files would be ['_baz.css', 'bar.css'].

extensions

Type: array or string Default: .css

Defines file extensions which will be looked for.

License

MIT © Bogdan Chadkin

changelog

4.0.0

  • Update postcss to ^8.4.0 (major)
  • Update postcss-import to ^14.0.0 (major)
  • Update minimum Node version to >=10.0.0 (major)

3.0.0

  • Update postcss-import to 10.0.0
  • Update pify to 3.0.0
  • Update is-glob to 4.0.0
  • Update postcss to 6.0.11

2.1.0

  • Add ability to glob inside node_modules and web_modules - #16

2.0.0

  • Remove glob option and infer type of from the import path. Allows a mixture of glob and module imports to be used - (#14)
  • When prefix is set resolve non-prefixed version of a file if that is the only match, otherwise always favour the prefixed version - (commit)
  • Update ava 0.11.0 -> 0.16.0
  • Update eslint 2.0.0 -> 3.11.1
  • Update globby 4.0.0 -> 6.1.0
  • Update postcss-import 8.0.2 -> 9.1.0
  • Drop Node 0.12 support. Reached EOL on 31/12/2016 - (link)

1.0.1

  • Fix package.json files filter

1.0.0

  • Initial release