Skip to content

Commit e96a462

Browse files
iamDecodedanburzo
authored andcommitted
Make compatible with latest rollup. Fixes #1. (#2)
* fix: Make compatible with latest rollup * Fix indents
1 parent a52df8b commit e96a462

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ export default (opts) => {
2929
},
3030

3131
ongenerate(opts, bundle) {
32+
let modules = Array.isArray(bundle.modules) ? bundle.modules
33+
: Object.getOwnPropertyNames(bundle.modules)
3234
let css = Object.entries(styles)
33-
.sort((a, b) => bundle.modules.indexOf(a[0]) - bundle.modules.indexOf(b[0]))
35+
.sort((a, b) => modules.indexOf(a[0]) - modules.indexOf(b[0]))
3436
.map(entry => entry[1])
3537
.join('\n');
3638
bundles[opts.file] = css;
@@ -47,4 +49,4 @@ export default (opts) => {
4749
);
4850
}
4951
}
50-
}
52+
}

0 commit comments

Comments
 (0)