-
Notifications
You must be signed in to change notification settings - Fork 204
Open
Labels
javascriptPull requests that update Javascript codePull requests that update Javascript code
Description
Is your enhancement related to a problem? Please describe.
Webpack aliases (and similar features in other bundles) often cause more harm than good.
With alias we can convert imports like this:
import MyComponent from './components/MyComponent';into something like this
import MyComponent from '@components/MyComponent';The benefit is that you simplify importing files from deeply nested folders:
import MyComponent from '../../../components/MyComponent';However, there are a couple of issues:
- It's not a JS standard
- It is not immediately clear (especially for new engineers) where the file is located, i.e, they would have to know the aliases first.
- The aliases must be set up on every tool used in a project (eslint, ts, jest, storybooks etc).
- IDE and editors won't recognize the aliases (at least by default)
Describe the solution you'd like
Discourage usage of webpack aliases and similar 10up across projects at 10up.
Additional context
Many projects inside and outside at 10up have experimented using webpack aliases and eventually decided to stop using them.
lkraav
Metadata
Metadata
Assignees
Labels
javascriptPull requests that update Javascript codePull requests that update Javascript code