Skip to content
This repository was archived by the owner on May 6, 2022. It is now read-only.
This repository was archived by the owner on May 6, 2022. It is now read-only.

Simplify component import paths using aliasing #15

@developher-net

Description

@developher-net

When importing components into pages, it gets very tedious to write deep relative paths.

// /pages/path/to/my/page/index.jsx
import Button from '../../../../../components/atoms/Button'

If the page route changes (and therefore the location of the file) the relative paths all need to be updated, which is a lot of unnecessary work.

This can be solved with module-alias which provides a method of aliasing these for easier use:

// /pages/path/to/my/page/index.jsx
import Button from '@atoms/Button'

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions