import '@/icon';
import '@/vab/styles/vab.scss';
export function setupVab(app) {
  const requireVabLayouts = require.context('vab-layouts', true, /\.vue$/);
  requireVabLayouts.keys().forEach(fileName => {
    const componentConfig = requireVabLayouts(fileName);
    const componentName = componentConfig.default.name;
    app.component(componentName, componentConfig.default || componentConfig);
  });
  const requireLayout = require.context('@/vab/layouts', true, /\.vue$/);
  requireLayout.keys().forEach(fileName => {
    const componentConfig = requireLayout(fileName);
    const componentName = componentConfig.default.name;
    app.component(componentName, componentConfig.default || componentConfig);
  });
  const requireComponent = require.context('@/vab/components', true, /\.vue$/);
  requireComponent.keys().forEach(fileName => {
    const componentConfig = requireComponent(fileName);
    const componentName = componentConfig.default.name;
    app.component(componentName, componentConfig.default || componentConfig);
  });
  const requirePlugin = require.context('@/vab/plugins', true, /\.js$/);
  requirePlugin.keys().forEach(fileName => {
    requirePlugin(fileName).setup(app);
  });
}
