Skip to content

Commit ec932c2

Browse files
committed
1 parent 06c0b2a commit ec932c2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lib/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ module.exports = (opts = {}) => {
4545
const { name, url } = parseRuleDefinition(node.params);
4646
const { params, selectors } = getRuleParams(node);
4747
const loader = {
48-
id: resolveId(file, url, opts),
48+
id: typeof opts.resolve === "function"
49+
? opts.resolve(file, url, opts)
50+
: resolveId(file, url, opts),
4951
parent: file,
5052
params,
5153
selectors,
@@ -71,7 +73,10 @@ module.exports = (opts = {}) => {
7173
statements.loaders.forEach(
7274
({ url, params, valueNode, parsedValue }) => {
7375
const loader = {
74-
id: resolveId(file, url, opts),
76+
id:
77+
typeof opts.resolve === "function"
78+
? opts.resolve(file, url, opts)
79+
: resolveId(file, url, opts),
7580
parent: file,
7681
params,
7782
selectors: {},

lib/resolveId.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ module.exports = function resolveId(file, url, opts) {
1212
return absolutePath;
1313
}
1414
}
15-
16-
return absolutePath;
1715
}
1816

1917
if (file) {

0 commit comments

Comments
 (0)