Created
September 7, 2017 17:26
-
-
Save eyn/deda28b68390fc81cbe7145cc43513ea to your computer and use it in GitHub Desktop.
Resolver Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MaterialUIIconResolver = { | |
apply(resolver) { | |
resolver.plugin("module", function resolve(request, callback) { | |
if (/material-ui-icons/.test(request.context.issuer)) { | |
if (request.request === "material-ui/SvgIcon") { | |
const newRequest = Object.assign({}, request, { | |
request: "material-ui-next/SvgIcon" | |
}); | |
return this.doResolve( | |
"resolve", | |
newRequest, | |
"Rewrote material-ui-icons request from material-ui to material-ui-next", | |
callback | |
); | |
} | |
} | |
callback(); | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment