Skip to content

Instantly share code, notes, and snippets.

@saionaro
Created September 2, 2019 07:53
Show Gist options
  • Save saionaro/9b98ed428c3482c834bea32a187425bb to your computer and use it in GitHub Desktop.
Save saionaro/9b98ed428c3482c834bea32a187425bb to your computer and use it in GitHub Desktop.
Cutting off extra Ant Design icons from a Webpack bundle. ~400 kb bundle size reduce
// export the only icons you need
export {
default as DownOutline
} from "@ant-design/icons/lib/outline/DownOutline";
export {
default as UpOutline
} from "@ant-design/icons/lib/outline/UpOutline";
// redirect icon paths to your own file
module.exports = {
...
resolve: {
...
alias: {
...
"@ant-design/icons/lib/dist$": path.join(srcDir, "antd-icons.js")
...
}
...
}
...
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment