All Downloads are FREE. Search and download functionalities are using the official Maven repository.

frontend.src.index.js Maven / Gradle / Ivy

There is a newer version: 3.0.0-alpha-29
Show newest version

import Vue from "vue";

import upperFirst from 'lodash/upperFirst'
import camelCase from 'lodash/camelCase'

const requireComponent = require.context(
    './components',
    false,
    /Elepy[A-Z]\w+\.(vue|js)$/
);

requireComponent.keys().forEach(fileName => {
    const componentConfig = requireComponent(fileName);

    const componentName = upperFirst(
        camelCase(
            // Gets the file name regardless of folder depth
            fileName
                .split('/')
                .pop()
                .replace(/\.\w+$/, '')
        )
    );


    Vue.component(
        componentName,
        componentConfig.default || componentConfig
    )
});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy