Skip to content

Commit c235e15

Browse files
authored
Merge pull request #36 from jonaskohl/master
Add support for async transform function
2 parents 5fb03b0 + 2a4cc96 commit c235e15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ export default (options = {}) => {
4848
name: "import-css",
4949

5050
/* convert the css file to a module and save the code for a file output */
51-
transform(code, id) {
51+
async transform(code, id) {
5252
if (!filter(id)) return;
5353

54-
const transformedCode = (options.minify) ? minifyCSS(options.transform(code)) : options.transform(code);
54+
const transformedCode = (options.minify) ? minifyCSS(await options.transform(code)) : await options.transform(code);
5555

5656
/* cache the result */
5757
if (!styles[id] || styles[id] != transformedCode) {

0 commit comments

Comments
 (0)