fixed vite error messages
This commit is contained in:
parent
4d310220dd
commit
a4dec279dc
@ -1,7 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import { Stepper, Step } from '@skeletonlabs/skeleton';
|
import { Stepper, Step } from '@skeletonlabs/skeleton';
|
||||||
import { form, field } from 'svelte-forms';
|
|
||||||
import { required, between } from 'svelte-forms/validators';
|
|
||||||
|
|
||||||
let step = 1;
|
let step = 1;
|
||||||
let name = '';
|
let name = '';
|
||||||
|
@ -3,8 +3,12 @@ import componentNames from 'virtual:components-list';
|
|||||||
const components = {};
|
const components = {};
|
||||||
|
|
||||||
componentNames.forEach(path => {
|
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 name = path.split('/').pop(); // Extract just the file name from the path
|
||||||
components[name] = () => import( /* @vite-ignore */ `/src/lib/components/${path}.svelte`);
|
const componentPath = `../components/${path}.svelte`; // Update the path as per your file structure
|
||||||
|
|
||||||
|
// Suppress warning for dynamic import
|
||||||
|
components[name] = () => import(/* @vite-ignore */ componentPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
export default components;
|
export default components;
|
||||||
|
@ -7,7 +7,7 @@ export const dataStore = writable({});
|
|||||||
|
|
||||||
// Dynamically import the data modules and assign them to the store
|
// Dynamically import the data modules and assign them to the store
|
||||||
dataSources.forEach(src => {
|
dataSources.forEach(src => {
|
||||||
import(`/src/lib/data/${src}.ts`).then(module => {
|
import(/* @vite-ignore */ `../data/${src}.ts`).then(module => {
|
||||||
// Here, explicitly extract the required data or function from the module
|
// Here, explicitly extract the required data or function from the module
|
||||||
const moduleData = module[src] || module.default;
|
const moduleData = module[src] || module.default;
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
// servicesLoader.ts
|
||||||
import serviceNames from 'virtual:services-list';
|
import serviceNames from 'virtual:services-list';
|
||||||
|
|
||||||
const services: { [key: string]: Function } = {};
|
const services: { [key: string]: Function } = {};
|
||||||
|
|
||||||
serviceNames.forEach(path => {
|
serviceNames.forEach(path => {
|
||||||
const serviceName = path.split('/').pop().replace('.ts', '');
|
const serviceName = path.split('/').pop().replace('.ts', '');
|
||||||
services[serviceName] = () => import(/* @vite-ignore */ `/src/lib/services/${path}`)
|
services[serviceName] = () => import(/* @vite-ignore */ `../services/${path}.ts`)
|
||||||
.then(mod => {
|
.then(mod => {
|
||||||
console.log(`Loaded service ${serviceName} with the following properties:`, Object.keys(mod));
|
console.log(`Loaded service ${serviceName} with the following properties:`, Object.keys(mod));
|
||||||
if (mod.default) return mod.default;
|
if (mod.default) return mod.default;
|
||||||
@ -13,4 +14,3 @@ serviceNames.forEach(path => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export default services;
|
export default services;
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import Composite from '$lib/core/Composite.svelte';
|
import Composite from '$lib/core/Composite.svelte';
|
||||||
|
|
||||||
let composite = {
|
let composite = {
|
||||||
id: 'validationexample',
|
id: 'test',
|
||||||
component: 'Form'
|
component: 'Flows'
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user