1234567891011121314151617181920212223242526272829303132 |
- const modules = {}
- const replaceName = {}
- const excludeCommponents = []
- function importComponents (files) {
- files.keys().forEach(key => {
-
- const reg = new RegExp('(.\\/)(.*)(\\/)')
- let moduleName = key.match(reg)[0].replace(/(\.\/)|(\/)|(src)/g, '')
-
- if (replaceName[moduleName]) {
- moduleName = replaceName[moduleName]
- }
- if (!excludeCommponents.includes(moduleName)) {
- modules[moduleName] = files(key).default
- }
- })
- }
- importComponents(require.context('data-room-ui/BasicComponents', true, /\index.vue$/))
- importComponents(require.context('data-room-ui/Borders', true, /\index.vue$/))
- importComponents(require.context('data-room-ui/Decorations', true, /\index.vue$/))
- export default modules
|