my-animated-components 1.0.3 → 1.0.4
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.
- package/dist/index.js +5 -5
- package/dist/src/index.d.ts +2 -4
- package/package.json +1 -1
- package/src/index.ts +6 -6
package/dist/index.js
CHANGED
|
@@ -63,14 +63,14 @@ const loadComponents = (componentsPath) => {
|
|
|
63
63
|
|
|
64
64
|
// Set the path to your components directory
|
|
65
65
|
const componentsPath = './components';
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// Export components dynamically
|
|
66
|
+
let componentsExports = {};
|
|
67
|
+
// Dynamically load the components
|
|
69
68
|
loadComponents(componentsPath)
|
|
70
69
|
.then((components) => {
|
|
71
70
|
components.forEach(({ name, component }) => {
|
|
72
71
|
if (component) {
|
|
73
|
-
|
|
72
|
+
// Dynamically assign each component to the componentsExports object
|
|
73
|
+
componentsExports[name] = component;
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
})
|
|
@@ -78,4 +78,4 @@ loadComponents(componentsPath)
|
|
|
78
78
|
console.error('Error loading components:', err);
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
-
export {
|
|
81
|
+
export { componentsExports };
|
package/dist/src/index.d.ts
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -4,15 +4,15 @@ import { loadComponents } from './utils/Listfiles';
|
|
|
4
4
|
// Set the path to your components directory
|
|
5
5
|
const componentsPath = './components';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
const dynamicExports: { [key: string]: any } = {};
|
|
7
|
+
let componentsExports: Record<string, any> = {};
|
|
9
8
|
|
|
10
|
-
//
|
|
9
|
+
// Dynamically load the components
|
|
11
10
|
loadComponents(componentsPath)
|
|
12
11
|
.then((components) => {
|
|
13
12
|
components.forEach(({ name, component }: any) => {
|
|
14
13
|
if (component) {
|
|
15
|
-
|
|
14
|
+
// Dynamically assign each component to the componentsExports object
|
|
15
|
+
componentsExports[name] = component;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
})
|
|
@@ -20,5 +20,5 @@ loadComponents(componentsPath)
|
|
|
20
20
|
console.error('Error loading components:', err);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
export {
|
|
23
|
+
// After loading, export all components from the componentsExports object
|
|
24
|
+
export { componentsExports };
|