postcss-import
Advanced tools
Comparing version 8.0.2 to 8.1.0
@@ -0,1 +1,6 @@ | ||
# 8.1.0 - 2016-04-04 | ||
- Added: JSPM browser field | ||
([#186](https://github.com/postcss/postcss-import/pull/186)) | ||
# 8.0.2 - 2015-01-27 | ||
@@ -13,2 +18,5 @@ | ||
**All imports statements must be at the top of your file now, per CSS specification.** | ||
You should use [postcss-reporter](https://github.com/postcss/postcss-reporter) to see the warnings raised. | ||
- Removed: async mode/option (now async by default) | ||
@@ -15,0 +23,0 @@ ([#107](https://github.com/postcss/postcss-import/pull/107)) |
{ | ||
"name": "postcss-import", | ||
"version": "8.0.2", | ||
"version": "8.1.0", | ||
"description": "PostCSS plugin to import CSS files", | ||
@@ -42,3 +42,9 @@ "keywords": [ | ||
"extends": "eslint-config-i-am-meticulous/es5" | ||
}, | ||
"jspm": { | ||
"browser": { | ||
"./lib/load-content": "@empty", | ||
"./lib/resolve-id": "@empty" | ||
} | ||
} | ||
} |
@@ -32,2 +32,6 @@ # postcss-import | ||
If this behavior is not what you want, look at `skipDuplicates` option | ||
- **If you are looking for glob, or sass like imports (prefixed partials)**, | ||
please look at | ||
[postcss-easy-import](https://github.com/trysound/postcss-easy-import) | ||
(which use this plugin under the hood). | ||
@@ -130,5 +134,13 @@ ## Installation | ||
A function to transform the content of imported files. Take one argument (file | ||
content) and should return the modified content or promise with it. | ||
content) and should return the modified content or a resolved promise with it. | ||
`undefined` result will be skipped. | ||
```js | ||
transform: function(css) { | ||
return postcss([somePlugin]).process(css).then(function(result) { | ||
return result.css; | ||
}); | ||
} | ||
``` | ||
#### `plugins` | ||
@@ -180,15 +192,21 @@ | ||
Type: `Function` | ||
Type: `Object` | ||
Default: null | ||
Allow to generate and call a callback that take one argument, the object from | ||
which you need to call `addDependency` from. | ||
Called whenever a file is imported, handy in a webpack workflow. | ||
It's equivalent to `onImport` with the following code: | ||
An object with `addDependency()` method, taking file path as an argument. | ||
Called whenever a file is imported. | ||
You can use it for hot-reloading in webpack `postcss-loader` like this: | ||
```js | ||
{ | ||
onImport: function (files) { | ||
files.forEach(this.addDependency) | ||
}.bind(obj) // obj = the argument you should pass to `addDependencyTo()` | ||
postcss: function(webpack) { | ||
return [ | ||
require('postcss-import')({ | ||
addDependencyTo: webpack | ||
/* Is equivalent to | ||
onImport: function (files) { | ||
files.forEach(this.addDependency) | ||
}.bind(webpack) | ||
*/ | ||
}) | ||
] | ||
} | ||
@@ -195,0 +213,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29593
240