require-icons.js 244 Bytes
Newer Older
冯超鹏's avatar
冯超鹏 committed
1 2 3 4 5 6 7 8 9 10
const req = require.context('@/icons/svg', false, /\.svg$/);
const requireAll = requireContext => requireContext.keys();

const re = /\.\/(.*)\.svg/;

const icons = requireAll(req).map(i => {
  return i.match(re)[1];
});

export default icons;