You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,13 @@ Default: `false`
121
121
122
122
Set to `true` if you want @import rules to parse glob patterns.
123
123
124
+
#### `resolve`
125
+
126
+
Type: `Function`
127
+
Default: `null`
128
+
129
+
You can overwrite the default path resolving way by setting this option, using the `resolve.sync(id, opts)` signature that [resolve.sync](https://github.com/substack/node-resolve#resolvesyncid-opts) has.
Copy file name to clipboardExpand all lines: test/index.js
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -190,3 +190,19 @@ test("works with no styles at all", function(t) {
190
190
191
191
t.end()
192
192
})
193
+
194
+
test("@import custom resolve",function(t){
195
+
varresolve=require("resolve")
196
+
varsassResolve=function(file,opts){
197
+
opts=opts||{}
198
+
opts.extensions=[".scss",".css"]
199
+
opts.packageFilter=function(pkg){
200
+
pkg.main=pkg.sass||pkg.style||"index"
201
+
returnpkg
202
+
}
203
+
returnresolve.sync(file,opts)
204
+
}
205
+
compareFixtures(t,"custom-resolve-modules","should be able to consume modules in the custom-resolve way",{root: __dirname,path: importsDir,resolve: sassResolve})
0 commit comments