Skip to content

Commit 7007e24

Browse files
committed
5.1.0
1 parent 08d2cc6 commit 7007e24

File tree

6 files changed

+24
-3
lines changed

6 files changed

+24
-3
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 5.1.0 - 2015-02-17
2+
3+
- Added: files with the same content will only be imported once. Previously, only the full path was used to determine if a file has already been imported in a given scope.
4+
Now, we also test create a hash with the content of the file to check if a file with the same content has not already been imported.
5+
This might be usefull if some modules you import are importing the same library from different places (eg: normalize might be as dep for several modules located in different places in `node_modules`)
6+
([#29](https://github.com/postcss/postcss-import/pull/28))
7+
18
# 5.0.3 - 2015-02-16
29

310
- Fixed: regression of 5.0.2: AST parent references were not updated ([#25](https://github.com/postcss/postcss-import/issues/25))

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
> [PostCSS](https://github.com/postcss/postcss) plugin to transform `@import` rules by inlining content.
44
5-
This plugin can consume local files or node modules. To resolve path of an `@import` rule, it can look into root directory (by default `process.cwd()`), `node_modules`, `web_modules` or local modules. You can also provide manually multiples paths where to look at.
5+
This plugin can consume local files or node modules.
6+
To resolve path of an `@import` rule, it can look into root directory (by default `process.cwd()`), `node_modules`, `web_modules` or local modules.
7+
You can also provide manually multiples paths where to look at.
68

7-
_Note: This plugin works great with [postcss-url](https://github.com/postcss/postcss-url) plugin, which will allow you to adjust assets `url()` (or even inline them) after inlining imported files._
9+
**Notes:**
10+
11+
- This plugin works great with [postcss-url](https://github.com/postcss/postcss-url) plugin,
12+
which will allow you to adjust assets `url()` (or even inline them) after inlining imported files.
13+
- In order to optimize output, this plugin will only import a file once on a given scope (root, media query...). Tests are made from the path & the content of imported files (using a hash table).
814

915
## Installation
1016

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-import",
3-
"version": "5.0.3",
3+
"version": "5.1.0",
44
"description": "PostCSS plugin to import CSS files",
55
"keywords": [
66
"css",
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
foo{}

test/fixtures/no-duplicate.css

+3
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
@import "foo.css";
33
@import "foo-duplicate.css";
44

5+
@import "foo.css" screen;
6+
@import "foo-duplicate2" screen;
7+
58
content{}
+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
foo{}
22

3+
@media screen{
4+
foo{}
5+
}
6+
37
content{}

0 commit comments

Comments
 (0)