Skip to content

Instantly share code, notes, and snippets.

@eyn
Created September 7, 2017 17:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eyn/deda28b68390fc81cbe7145cc43513ea to your computer and use it in GitHub Desktop.
Save eyn/deda28b68390fc81cbe7145cc43513ea to your computer and use it in GitHub Desktop.
Resolver Plugin
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