Skip to content

Offer a way to import files relative to src/ #581

Closed
@gaelollivier

Description

@gaelollivier

Not really sure about this, but I find it quite annoying to have imports that look like:

import mock from "../../../testUtils/myMock"

Relative paths are good for resources that will always live next to the calling file but when referring to shared helpers/modules I find them quite counter-productive.

It would be possible to configure webpack so we could import files from src/ just like import 'testUtils/myMock or maybe src/testUtils/myMock by adding src to the resolve root.

Would it make sense ? Maybe relative paths are not that bad and I'm missing something ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions