Skip to content

Commit 9e5a45d

Browse files
refactor: avoid lodash.tail (#707)
1 parent e279f2a commit 9e5a45d

File tree

4 files changed

+1932
-1232
lines changed

4 files changed

+1932
-1232
lines changed

lib/loader.js

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ function sassLoader(content) {
9191
);
9292

9393
if (stdinIndex !== -1) {
94+
// eslint-disable-next-line no-param-reassign
9495
result.map.sources[stdinIndex] = path.relative(
9596
process.cwd(),
9697
resourcePath

lib/webpackImporter.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
const path = require('path');
2020

21-
const tail = require('lodash.tail');
22-
2321
const importsToResolve = require('./importsToResolve');
2422

2523
const matchCss = /\.css$/;
@@ -57,7 +55,11 @@ function webpackImporter(resourcePath, resolve, addNormalizedDependency) {
5755
file: resolvedFile.replace(matchCss, ''),
5856
};
5957
},
60-
() => startResolving(dir, tail(importsToResolve))
58+
() => {
59+
const [, ...tailResult] = importsToResolve;
60+
61+
return startResolving(dir, tailResult);
62+
}
6163
);
6264
}
6365

0 commit comments

Comments
 (0)