Skip to content

Add './src' as a default resolve path #1015

Closed
@codebryo

Description

@codebryo

What problem does this feature solve?

As the app grows, managing the dependencies should be as simple and consistent as possible.
With complexity and multiple folders it can be tedious to travers through all the paths using relative references.

import Bar from '../../components/foo/Bar'
// Better
import Bar from 'components/foo/Bar'

This is super simple to do in Webpack.
Currently I create a config file looking like this:

module.exports = {
  chainWebpack: config => {
    config.resolve.modules.add("./src");
  }
};

What does the proposed API look like?

Adding ./src to the default webpack config would make this easier for many people and prevent some errors for some developers as the path can always be used from the actual src folder.

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