Skip to content

Commit 214844d

Browse files
committed
8.0.0
1 parent 5444e79 commit 214844d

File tree

3 files changed

+72
-39
lines changed

3 files changed

+72
-39
lines changed

CHANGELOG.md

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
1-
- Removed: async mode/option
2-
([#107](https://github.com/postcss/postcss-import/pull/107))
3-
- Removed: "bower_components" not supported by default anymore, use "path" option to add it back
4-
([#116](https://github.com/postcss/postcss-import/pull/116))
5-
- Changed: custom resolve has more responsibility for paths resolving.
6-
See [resolve option](https://github.com/postcss/postcss-import#resolve) for more information about this change
7-
([#116](https://github.com/postcss/postcss-import/pull/116))
8-
- Added: custom resolve function can return array of paths
9-
([#120](https://github.com/postcss/postcss-import/pull/120))
10-
- Added: custom syntax in imported files support
11-
([#130](https://github.com/postcss/postcss-import/pull/130))
12-
- Added: support custom `load` option
13-
([#144](https://github.com/postcss/postcss-import/pull/144))
14-
- Removed: `encoding` option.
15-
([#144](https://github.com/postcss/postcss-import/pull/144))
1+
# 8.0.0 - 2015-01-27
162

17-
Encoding can be specified in custom `load` option
3+
- Removed: async mode/option (now async by default)
4+
([#107](https://github.com/postcss/postcss-import/pull/107))
5+
- Removed: "bower_components" not supported by default anymore,
6+
use "path" option to add it back
7+
- Removed: `encoding` option. Encoding can be specified in custom `load` option
188

199
```js
2010
postcssImport({
@@ -23,6 +13,7 @@ postcssImport({
2313
}
2414
})
2515
```
16+
([#144](https://github.com/postcss/postcss-import/pull/144))
2617

2718
- Removed: glob support
2819
([#146](https://github.com/postcss/postcss-import/pull/146))
@@ -37,12 +28,31 @@ postcssImport({
3728
})
3829
```
3930

40-
- Changed: support promise in `transform` option and `undefined` result will be skipped
31+
([#116](https://github.com/postcss/postcss-import/pull/116))
32+
- Changed: custom resolve has more responsibility for paths resolving.
33+
See [resolve option](https://github.com/postcss/postcss-import#resolve)
34+
for more information about this change
35+
([#116](https://github.com/postcss/postcss-import/pull/116))
36+
- Changed: support promise in `transform` option and `undefined` result will be
37+
skipped
4138
([#147](https://github.com/postcss/postcss-import/pull/147))
39+
- Changed: `options.plugins` are applied to unprocessed ast before imports
40+
detecting
41+
([157](https://github.com/postcss/postcss-import/pull/157))
42+
- Added: custom resolve function can return array of paths
43+
([#120](https://github.com/postcss/postcss-import/pull/120))
44+
- Added: custom syntax in imported files support
45+
([#130](https://github.com/postcss/postcss-import/pull/130))
46+
- Added: support custom `load` option
47+
([#144](https://github.com/postcss/postcss-import/pull/144))
4248
- Added: detect css extension in package.json `main` field
4349
([153](https://github.com/postcss/postcss-import/pull/153))
44-
- Changed: `options.plugins` are applied to unprocessed ast before imports detecting
45-
([157](https://github.com/postcss/postcss-import/pull/157))
50+
51+
**Note:**
52+
_If you miss options/default behavior (glob etc), a new plugin will handle all
53+
those things.
54+
Please follow issue [#145](https://github.com/postcss/postcss-import/issues/145)
55+
_
4656

4757
# 7.1.3 - 2015-11-05
4858

README.md

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
1-
# postcss-import [![Travis Build Status](https://travis-ci.org/postcss/postcss-import.svg)](https://travis-ci.org/postcss/postcss-import) [![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/u8l6u3lr6s5u5tpi?svg=true)](https://ci.appveyor.com/project/MoOx/postcss-import)
1+
# postcss-import
22

3-
> [PostCSS](https://github.com/postcss/postcss) plugin to transform `@import` rules by inlining content.
3+
[![Unix Build status](https://img.shields.io/travis/postcss/postcss-import/master.svg?branch=master&label=unix%20build)](https://travis-ci.org/postcss/postcss-import)
4+
[![Windows Build status](https://img.shields.io/appveyor/ci/MoOx/postcss-import/master.svg?label=window%20build)](https://ci.appveyor.com/project/MoOx/postcss-import/branch/master)
5+
[![Version](https://img.shields.io/npm/v/postcss-import.svg)](https://github.com/postcss/postcss-import/blob/master/CHANGELOG.md)
6+
7+
8+
> [PostCSS](https://github.com/postcss/postcss) plugin to transform `@import`
9+
rules by inlining content.
410

511
This plugin can consume local files, node modules or bower packages.
612
To resolve path of an `@import` rule, it can look into root directory
713
(by default `process.cwd()`), `web_modules`, `node_modules`
814
or local modules.
915
_When importing a module, it will looks for `index.css` or file referenced in
10-
`package.json` in the `style` field._
16+
`package.json` in the `style` or `main` fields._
1117
You can also provide manually multiples paths where to look at.
1218

1319
**Notes:**
1420

15-
- **This plugin should probably be used as the first plugin of your list. This way, other plugins will work on the AST as if there were only a single file to process, and will probably work as you can expect**.
16-
- This plugin works great with [postcss-url](https://github.com/postcss/postcss-url) plugin,
17-
which will allow you to adjust assets `url()` (or even inline them) after inlining imported files.
18-
- In order to optimize output, **this plugin will only import a file once** on a given scope (root, media query...).
19-
Tests are made from the path & the content of imported files (using a hash table).
21+
- **This plugin should probably be used as the first plugin of your list.
22+
This way, other plugins will work on the AST as if there were only a single file
23+
to process, and will probably work as you can expect**.
24+
- This plugin works great with
25+
[postcss-url](https://github.com/postcss/postcss-url) plugin,
26+
which will allow you to adjust assets `url()` (or even inline them) after
27+
inlining imported files.
28+
- In order to optimize output, **this plugin will only import a file once** on
29+
a given scope (root, media query...).
30+
Tests are made from the path & the content of imported files (using a hash
31+
table).
2032
If this behavior is not what you want, look at `skipDuplicates` option
2133

2234
## Installation
@@ -27,7 +39,9 @@ $ npm install postcss-import
2739

2840
## Usage
2941

30-
If your stylesheets are not in the same place where you run postcss (`process.cwd()`), you will need to use `from` option to make relative imports work from input dirname.
42+
If your stylesheets are not in the same place where you run postcss
43+
(`process.cwd()`), you will need to use `from` option to make relative imports
44+
work from input dirname.
3145

3246
```js
3347
// dependencies
@@ -55,7 +69,7 @@ postcss()
5569
Using this `input.css`:
5670

5771
```css
58-
/* can consume `node_modules`, `web_modules`, `bower_components` or local modules */
72+
/* can consume `node_modules`, `web_modules` or local modules */
5973
@import "cssrecipes-defaults"; /* == @import "./node_modules/cssrecipes-defaults/index.css"; */
6074
@import "normalize.css"; /* == @import "./node_modules/normalize.css/normalize.css"; */
6175

@@ -92,10 +106,13 @@ Checkout [tests](test) for more examples.
92106
#### `root`
93107

94108
Type: `String`
95-
Default: `process.cwd()` or _dirname of [the postcss `from`](https://github.com/postcss/postcss#node-source)_
109+
Default: `process.cwd()` or _dirname of
110+
[the postcss `from`](https://github.com/postcss/postcss#node-source)_
96111

97-
Define the root where to resolve path (eg: place where `node_modules` are). Should not be used that much.
98-
_Note: nested `@import` will additionally benefit of the relative dirname of imported files._
112+
Define the root where to resolve path (eg: place where `node_modules` are).
113+
Should not be used that much.
114+
_Note: nested `@import` will additionally benefit of the relative dirname of
115+
imported files._
99116

100117
#### `path`
101118

@@ -109,30 +126,33 @@ A string or an array of paths in where to look for files.
109126
Type: `Function`
110127
Default: `null`
111128

112-
A function to transform the content of imported files. Take one argument (file content) and should return the modified content or promise with it.
129+
A function to transform the content of imported files. Take one argument (file
130+
content) and should return the modified content or promise with it.
113131
`undefined` result will be skipped.
114132

115133
#### `plugins`
116134

117135
Type: `Array`
118136
Default: `undefined`
119137

120-
An array of plugins to be applied on each imported file.
138+
An array of plugins to be applied on each imported files.
121139

122140
#### `onImport`
123141

124142
Type: `Function`
125143
Default: `null`
126144

127-
Function called after the import process. Take one argument (array of imported files).
145+
Function called after the import process. Take one argument (array of imported
146+
files).
128147

129148
#### `resolve`
130149

131150
Type: `Function`
132151
Default: `null`
133152

134153
You can overwrite the default path resolving way by setting this option.
135-
This function gets `(id, basedir, importOptions)` arguments and returns full path, array of paths or promise resolving paths.
154+
This function gets `(id, basedir, importOptions)` arguments and returns full
155+
path, array of paths or promise resolving paths.
136156
You can use [resolve](https://github.com/substack/node-resolve) for that.
137157

138158
#### `load`
@@ -141,7 +161,8 @@ Type: `Function`
141161
Default: null
142162

143163
You can overwrite the default loading way by setting this option.
144-
This function gets `(filename, importOptions)` arguments and returns content or promised content.
164+
This function gets `(filename, importOptions)` arguments and returns content or
165+
promised content.
145166

146167
#### `skipDuplicates`
147168

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-import",
3-
"version": "7.1.3",
3+
"version": "8.0.0",
44
"description": "PostCSS plugin to import CSS files",
55
"keywords": [
66
"css",
@@ -27,12 +27,14 @@
2727
"ava": "^0.11.0",
2828
"eslint": "^1.10.3",
2929
"eslint-config-i-am-meticulous": "^2.0.0",
30+
"npmpub": "^3.0.1",
3031
"postcss-scss": "^0.1.3"
3132
},
3233
"scripts": {
3334
"lint": "eslint .",
3435
"pretest": "npm run lint",
35-
"test": "ava"
36+
"test": "ava",
37+
"release": "npmpub"
3638
},
3739
"eslintConfig": {
3840
"extends": "eslint-config-i-am-meticulous/es5"

0 commit comments

Comments
 (0)