-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
♻️ Support absolute import paths #34264
Conversation
Hey @alanorozco! These files were changed:
Hey @jridgewell! These files were changed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated import statements look lovely!
Unfortunately, it is unclear to me that this is a net-positive.
- It adds a level of indirection. Just another item which is strange about AMP's build system.
- Do you know if "Click to Definition" will still work in IDEs? This is a huge convenience while working on the codebase and I'd hate to lose it for shorter lines.
I too am a bit mixed for the same reasons Jake mentioned. Would like to hear others thoughts though. |
This pull request fixes 7 alerts when merging 7206e5d into a8895fa - view on LGTM.com fixed alerts:
|
@samouri For a more "normal" feel, WDYT about if we used something like
|
This pull request fixes 7 alerts when merging 1690c8b into 2e762f0 - view on LGTM.com fixed alerts:
|
@@ -20,12 +20,14 @@ module.exports = ({config}) => { | |||
modules: [ | |||
path.join(__dirname, '../node_modules'), | |||
path.join(__dirname, '../../../../node_modules'), | |||
path.join(__dirname, '../../../..'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FMI: Does the Webpack config need to be updated somehow? Can Storybook still get files from src/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm understanding your question correctly, yes, Storybook should be able to use absolute imports as well
This pull request fixes 7 alerts when merging f9631c3 into fdad648 - view on LGTM.com fixed alerts:
|
This pull request fixes 7 alerts when merging a38ba07 into df5b6a1 - view on LGTM.com fixed alerts:
|
Writing to confirm that the |
This pull request fixes 7 alerts when merging adfbdb1 into df5b6a1 - view on LGTM.com fixed alerts:
|
Adopts an alias configuration very similar to NuxtJS:
@/
maps to the project root (import {dev, user} from '@/src/log'
)@@/
maps to shared core (import {dict} from '@@/types/object'
)Eliminates long strings of '../../../..' (and by extension makes it easier to refactor and move files since imports won't need updating)