Skip to content

Commit 7124d43

Browse files
authored
BREAKING: Remove transform option (#250)
Users can use the load option for this.
1 parent dfe4c23 commit 7124d43

7 files changed

+0
-56
lines changed

README.md

-17
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,6 @@ Default: `[]`
126126

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

129-
#### `transform`
130-
131-
Type: `Function`
132-
Default: `null`
133-
134-
A function to transform the content of imported files. Take one argument (file
135-
content) and should return the modified content or a resolved promise with it.
136-
`undefined` result will be skipped.
137-
138-
```js
139-
transform: function(css) {
140-
return postcss([somePlugin]).process(css).then(function(result) {
141-
return result.css;
142-
});
143-
}
144-
```
145-
146129
#### `plugins`
147130

148131
Type: `Array`

index.js

-9
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,6 @@ function loadImportContent(
308308
}
309309

310310
return Promise.resolve(options.load(filename, options))
311-
.then(function(content) {
312-
if (typeof options.transform !== "function") {
313-
return content
314-
}
315-
return Promise.resolve(options.transform(content, filename, options))
316-
.then(function(transformed) {
317-
return typeof transformed === "string" ? transformed : content
318-
})
319-
})
320311
.then(function(content) {
321312
if (content.trim() === "") {
322313
result.warn(filename + " is empty", { node: atRule })

test/fixtures/transform-content.css

-1
This file was deleted.

test/fixtures/transform-content.expected.css

-1
This file was deleted.

test/fixtures/transform-undefined.css

-1
This file was deleted.

test/fixtures/transform-undefined.expected.css

-1
This file was deleted.

test/transform.js

-26
This file was deleted.

0 commit comments

Comments
 (0)