提交 | 用户 | 时间 | ||
e57a89 | 1 | const req = require.context('../../../assets/icons/svg', false, /\.svg$/) |
懒 | 2 | const requireAll = requireContext => requireContext.keys() |
3 | ||
4 | const re = /\.\/(.*)\.svg/ | |
5 | ||
6 | const svgIcons = requireAll(req).map(i => { | |
7 | return i.match(re)[1] | |
8 | }) | |
9 | ||
10 | export default svgIcons |