question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Absolute path support for imports

See original GitHub issue

From 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:closed
  • Created 6 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
larrysalibracommented, Sep 22, 2017

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.

1reaction
kkomazcommented, Sep 22, 2017

@larrysalibra Yep! Just need some minor configurations via https://github.com/tleunen/babel-plugin-module-resolver

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found