benawad / destiny

Prettier for File Structures
MIT License
3.53k stars 80 forks source link

Cannot find import .yml file in svelte import #156

Open tqwewe opened 3 years ago

tqwewe commented 3 years ago

When running this on my svelte app, I receive the following error:

ERROR: Cannot find import ../data/menu-items.yml for /src/components/layout/Header.svelte

My Header.svelte file contains:

import menuItems from '../data/menu-items.yml'
import type { Submenu } from '../data/menu-items.yml'

When I comment out the import type line, destiny runs fine, but the import type line causes it to fail.

AnatoleLucet commented 3 years ago

Hi @Acidic9 can share a reproduction (codesandbox, gh repo, etc...) ? Thanks.

benawad commented 3 years ago

I think we just need to add yaml to https://github.com/benawad/destiny/blob/develop/src/index/shared/customResolve.ts

AnatoleLucet commented 3 years ago

I think we just need to add yaml to https://github.com/benawad/destiny/blob/develop/src/index/shared/customResolve.ts

Indeed