Absolute path support for imports
See original GitHub issueFrom a development perspective, support for absolute path would be great. With absolute path, we would no longer have to do deep nesting when importing utility functions or separate components. Example below
import { DROPBOX } from '../../../account/utils/index'
to
import { DROPBOX } from 'js/account/utils/index'
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Absolute Imports and Module Path Aliases
Configure module path aliases that allow you to remap certain import paths. ... Supported Browsers and Features ... Absolute Imports and Module path...
Read more >Absolute imports and module path aliases are a game ...
js has introduced the concept of absolute imports and module path alias options from v9.4. This is all possible through a config file...
Read more >Importing with Absolute Paths in JavaScript/TypeScript using ...
How to use absolute paths in JavaScript and TypeScript to improve your import statements, using the right webpack configuration.
Read more >Absolute vs Relative Imports in Python
An absolute import specifies the resource to be imported using its full path from the project's root folder. Syntax and Practical Examples. Let's...
Read more >Why and How to Use Absolute Imports in React
Easily copy-paste the code with imports into another file in the project and not have to tinker with import paths. It is short...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would be nice to have.
Keep in mind eslint and flow need to continue working along with the respective plugins in our editors. It looks like getting all of these to work requires adding a bunch of additional dependencies both to the project and to the plugins our editors use - not sure how well they are maintained.
I’m in general hesitant to add too many dependencies that aren’t widely used, but feel free to give it a go.
If it works well happy to merge it.
@larrysalibra Yep! Just need some minor configurations via https://github.com/tleunen/babel-plugin-module-resolver