Skip to content

ES6 Import Statement Without Relative Paths #505

Closed
@cguedes

Description

@cguedes

Is it planned to add import statements without relative paths (webpack) feature to create-react-app?

You can found info regarding this here and here.

With this we can do

import Header from 'components/Header';
import Grid from 'components/Grid';
import TransactionForm from 'containers/TransactionForm';
import TransactionSummary from 'containers/TransactionSummary';
import * as AppActions from 'actions';

instead of

import Header from '../../components/Header';
import Grid from '../../components/Grid';
import TransactionForm from '../TransactionForm';
import TransactionSummary from '../TransactionSummary';
import * as AppActions from '../../actions';

Activity

gaearon

gaearon commented on Aug 27, 2016

@gaearon
Contributor

We will likely support this via #476 but you would have to add the current directory to NODE_PATH yourself. We want to keep this explicit because it is quite prone to breakage.

Here is an example: reduxjs/redux#1681 (comment). We don’t want people to have issues like this so we won’t enable it by default.

locked and limited conversation to collaborators on Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @cguedes@gaearon

        Issue actions

          ES6 Import Statement Without Relative Paths · Issue #505 · facebook/create-react-app