Skip to content

Commit 62ea285

Browse files
committed
Fix bug importing from multiple sources
1 parent 4a422f0 commit 62ea285

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.tape.js

+8
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ module.exports = {
8484
expect: 'basic.import.expect.css',
8585
result: 'basic.import.result.css'
8686
},
87+
'basic:import-css-from-multiple-files': {
88+
message: 'supports { importFrom: ["test/empty.css", "test/import-selectors.css"] } usage',
89+
options: {
90+
importFrom: ["test/empty.css", "test/import-selectors.css"]
91+
},
92+
expect: 'basic.import.expect.css',
93+
result: 'basic.import.result.css'
94+
},
8795
'basic:import-css-from-type': {
8896
message: 'supports { importFrom: [ { from: "test/import-selectors.css", type: "css" } ] } usage',
8997
options: {

lib/import-from.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ export default function importCustomSelectorsFromSources(sources) {
8181
const type = (opts.type || path.extname(from).slice(1)).toLowerCase();
8282

8383
return { type, from };
84-
}).reduce(async (customSelectors, source) => {
84+
}).reduce(async (customSelectorsPromise, source) => {
85+
const customSelectors = await customSelectorsPromise
8586
const { type, from } = await source;
8687

8788
if (type === 'ast') {
@@ -101,7 +102,7 @@ export default function importCustomSelectorsFromSources(sources) {
101102
}
102103

103104
return Object.assign(customSelectors, importCustomSelectorsFromObject(await source));
104-
}, {});
105+
}, Promise.resolve({}));
105106
}
106107

107108
/* Helper utilities

test/empty.css

Whitespace-only changes.

0 commit comments

Comments
 (0)