Skip to content

Commit 5b08828

Browse files
author
Alexey Litvinov
committed
multiple extensions
1 parent 470a33a commit 5b08828

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,23 @@ module.exports = function setupHook({
121121
return tokens;
122122
};
123123

124+
const exts = toArray(extensions);
124125
const isException = buildExceptionChecker(ignore);
125126

126-
attachHook(filename => fetch(filename, filename), '.css', isException);
127+
// @todo add possibility to specify particular config for each extension
128+
exts.forEach(extension => attachHook(filename => fetch(filename, filename), '.css', isException));
127129
};
128130

131+
/**
132+
* @param {*} option
133+
* @return {array}
134+
*/
135+
function toArray(option) {
136+
return Array.isArray(option)
137+
? option
138+
: [option];
139+
}
140+
129141
/**
130142
* @param {function|regex|string} ignore glob, regex or function
131143
* @return {function}

0 commit comments

Comments
 (0)