Skip to content

Fails on imports of 'jpg' assets #70

@ValeryLosik

Description

@ValeryLosik

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.

pub const ASSET_EXTENSION: &[&str] = &["scss", "css", "svg", "png", "json", "gif"];

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions