Skip to content

Commit

Permalink
BREAKING: Remove transform option (#250)
Browse files Browse the repository at this point in the history
Users can use the load option for this.
  • Loading branch information
RyanZim authored Nov 29, 2016
1 parent dfe4c23 commit 7124d43
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 56 deletions.
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,23 +126,6 @@ Default: `[]`

A string or an array of paths in where to look for files.

#### `transform`

Type: `Function`
Default: `null`

A function to transform the content of imported files. Take one argument (file
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`

Type: `Array`
Expand Down
9 changes: 0 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,6 @@ function loadImportContent(
}

return Promise.resolve(options.load(filename, options))
.then(function(content) {
if (typeof options.transform !== "function") {
return content
}
return Promise.resolve(options.transform(content, filename, options))
.then(function(transformed) {
return typeof transformed === "string" ? transformed : content
})
})
.then(function(content) {
if (content.trim() === "") {
result.warn(filename + " is empty", { node: atRule })
Expand Down
1 change: 0 additions & 1 deletion test/fixtures/transform-content.css

This file was deleted.

1 change: 0 additions & 1 deletion test/fixtures/transform-content.expected.css

This file was deleted.

1 change: 0 additions & 1 deletion test/fixtures/transform-undefined.css

This file was deleted.

1 change: 0 additions & 1 deletion test/fixtures/transform-undefined.expected.css

This file was deleted.

26 changes: 0 additions & 26 deletions test/transform.js

This file was deleted.

0 comments on commit 7124d43

Please sign in to comment.