js-kompo-utils 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,14 @@
1
1
  export function getAllDefaultComponents() {
2
2
  const defaultComponents = {};
3
-
4
- const files = require.context('.', true, /\.vue$/i)
5
-
6
- files.keys().map(file => {
7
- const componentName = file.match(/\.\/(.*)\.vue/)[1];
8
- defaultComponents[componentName] = files(file).default;
3
+
4
+ const files = require.context('.', false, /\.vue$/i)
5
+
6
+ files.keys().forEach(file => {
7
+ const match = file.match(/^\.\/([\w-]+)\.vue$/);
8
+ if (match) {
9
+ defaultComponents[match[1]] = files(file).default;
10
+ }
9
11
  });
10
-
12
+
11
13
  return defaultComponents;
12
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-kompo-utils",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "main": "app.js",
6
6
  "scripts": {