Updated componentLoader and vite to load any folder depth
This commit is contained in:
10
src/lib/componentLoader.ts
Normal file
10
src/lib/componentLoader.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import componentNames from 'virtual:components-list';
|
||||
|
||||
const components = {};
|
||||
|
||||
componentNames.forEach(path => {
|
||||
const name = path.split('/').pop(); // Extract just the file name from the path
|
||||
components[name] = () => import( /* @vite-ignore */ `/src/lib/components/${path}.svelte`);
|
||||
});
|
||||
|
||||
export default components;
|
@ -1,9 +0,0 @@
|
||||
import componentNames from 'virtual:components-list';
|
||||
|
||||
const components = {};
|
||||
|
||||
componentNames.forEach(name => {
|
||||
components[name] = () => import(`$lib/components/${name}.svelte`);
|
||||
});
|
||||
|
||||
export default components;
|
@ -2,7 +2,6 @@
|
||||
import { onMount } from 'svelte';
|
||||
import { checkAndSignAuthMessage } from '@lit-protocol/lit-node-client';
|
||||
import { LOCAL_STORAGE_KEYS } from '@lit-protocol/constants';
|
||||
import Send from '$lib/Send.svelte';
|
||||
|
||||
let authSig = null;
|
||||
let error = null;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import Composite from './Composite.svelte'; // Recursive import
|
||||
import components from '$lib/components.ts';
|
||||
import components from '$lib/componentLoader';
|
||||
import { getContextStore } from '$lib/stores/contextStore.ts';
|
||||
|
||||
export let componentsData = {
|
||||
|
Reference in New Issue
Block a user