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