Skip to content

Commit 254be6b

Browse files
refactor: stuff
1 parent c49b5da commit 254be6b

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

lib/loader.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,22 @@ module.exports = function(content, map) {
3838
resolve: loaderContext.resolve
3939
};
4040

41+
const from =
42+
"/css-loader!" +
43+
loaderUtils
44+
.getRemainingRequest(loaderContext)
45+
.split("!")
46+
.pop();
47+
const to = loaderUtils
48+
.getCurrentRequest(loaderContext)
49+
.split("!")
50+
.pop();
51+
4152
postcss([plugin(parserOptions)])
4253
.process(content, {
4354
// we need a prefix to avoid path rewriting of PostCSS
44-
from:
45-
"/css-loader!" +
46-
loaderUtils
47-
.getRemainingRequest(loaderContext)
48-
.split("!")
49-
.pop(),
50-
to: loaderUtils
51-
.getCurrentRequest(loaderContext)
52-
.split("!")
53-
.pop(),
55+
from,
56+
to,
5457
map: sourceMap
5558
? {
5659
prev: map,

0 commit comments

Comments
 (0)