fix: 🐛 unplugin-svelte-components config

This commit is contained in:
Guz013
2023-06-19 14:48:48 -03:00
parent bac87a78fe
commit 41f72af999

View File

@@ -14,8 +14,7 @@ export default defineConfig({
plugins: [
SvelteImport({
include: [
/\.svelte/,
/\.svelte\?svelte/,
/\.svelte$/,
],
external: [
...findPathsByExtension(path.join(__dirname, 'src'), '.svx').map((filePath) => {
@@ -47,21 +46,18 @@ export default defineConfig({
}),
],
dirs: [
'./src/**/*',
'./src/lib',
],
importPathTransform: (importPath) => {
if (path.extname(importPath) === '.svg')
return `${importPath}?component`;
if (getFileName(importPath).startsWith('+'))
return '';
else return importPath;
},
dts: './src/lib/components.d.ts',
}),
AutoImport({
include: [
/\.svelte/,
/\.svelte\?svelte/,
/\.svelte$/,
/.[tj]sx?$/,
],
imports: [