Created
September 2, 2019 07:53
-
-
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
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
// 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"; |
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
// 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