Allowing webpack module aliases for plugins #760
Labels
build
Build related additions or modifications
enhancement
New feature or request
technical debt
If not paid, jeapardizes long-term success and maintainability of the repository.
Hello guys, I'm working a lot with plugins on OpenSearch Dashboards.
And my plugin is big and has a lot of features...
Then, I'm facing some challenges to developing inside the platform. Bellow, follow some challenges, that I solved with some modifications on
@osd/optimizer
.Please, could you read carefully and help me to merge if it's possible?
Is your feature request related to a problem? Please describe.
To avoid relative imports like "../../../../" on the "public" folder of a plugin, I made some modifications to receive module-alias with Bundle public interface already provided. It'll possibility to work with an alias on import, at least on the frontend plugin, on React part. We can import things like this:
import { Something } from '@my-weird-alias'
without placing a relative path to theSomething
object.My modifications are based on:
Describe the solution you'd like
I only would like to avoid terrible relative paths on imports and create my own aliases to import my components and screens. It'll be possibly with the
webpack
feature.Describe alternatives you've considered
Webpack
is used in all frontend plugins of Dashboards solution. Then, I didn't need to test another solution, because is more fancy and clear to use the built-in tools and packages installed.Additional context
Looking at my PR (#761) is clear to see the modifications. It's not big. I believe that's simple to understand what I mean.
The text was updated successfully, but these errors were encountered: