fixed dynamic loader bug
This commit is contained in:
@ -3,12 +3,8 @@ import componentNames from 'virtual:components-list';
|
||||
const components = {};
|
||||
|
||||
componentNames.forEach(path => {
|
||||
// Ensure imports start with ./ or ../ and end with a file extension
|
||||
const name = path.split('/').pop(); // Extract just the file name from the path
|
||||
const componentPath = `../components/${path}.svelte`; // Update the path as per your file structure
|
||||
|
||||
// Suppress warning for dynamic import
|
||||
components[name] = () => import(/* @vite-ignore */ componentPath);
|
||||
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;
|
||||
export default components;
|
Reference in New Issue
Block a user