Adjective-Object / good-fences-rs-core

9 stars 0 forks source link

Fails on imports of 'jpg' assets #70

Open ValeryLosik opened 7 months ago

ValeryLosik commented 7 months ago

Currently running good-fences on files with import of jpg throws errors.

Actual: throws could not find project local path src/common/table.jpg imported by src/common/table.ts with specifier ./table.jpg

Expected: should not throw error in importing of jpg files

Suggestion: I am new to rust, but I checked codebase, and it seems that a quick fix will be to extend this constant with jpg extension. https://github.com/Adjective-Object/good-fences-rs-core/blob/819ade47f1bc02a752a9dde8ec5dfb230feb39a1/src/import_resolver.rs#L57 However, there a lot of other extensions of files that are still missing(.html, mp3, mp4 can be imported to ts files via url-loader in webpack for instance) and will lead to the same problem, which makes me think that having it hardcoded in code is not a long-term solution. If there is a real need to have this collection listed,maybe adding additional cli parameter is a way to go.