-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix(imports): remove resolve.root config in webpack #140
Conversation
That makes sense to me, but I'm not sure if @levithomason would have any other feedback concerning this. I believe |
Developer convenience makes sense, but the package ultimately has to be able to be safely imported in other environments. I came across this while importing Stardust into another application without the required (and undocumented) configuration, and while it would be easy to add I wanted to put this out in the open. |
That said, I'm OK waiting on @levithomason for this, but it's a pretty critical fix that should be considered sooner rather than later. |
Oh yeah, I just mentioned that I think convenience was the primary motivating factor, so I don't think it's a big deal to do away with. It's easy to change either way, so 🍂 |
To make this work we'll need to circle through the components in the |
-1 to sweeping removal of root require. The import META from 'src/utils/Meta';
// vs
import META from '../../../../src/utils/Meta'; ^ That is a loss of readability and maintainability with no gain. Short term Long term EDIT |
Side note, PR titles end up in the CHANGELOG. Let's write them in consideration of others reading them as changelog bullets. |
Agreed about the inconvenience in test and docs, but it's definitely a necessity for the source code. Personally I don't see how this package could be reasonably compiled to a distribution bundle due to its dependencies on lodash/jquery/semantic/etc., so it's vital that the source code be easy to import. Sent from my iPhone
|
Also as a side note, the only reason I removed the aliases from the test bundle is that I wanted to ensure that the source code worked without relying on webpack's custom resolve utilities. Sent from my iPhone
|
Cool, we should merge this as soon as possible. It's borked ATM. EDIT |
fix(imports): remove resolve.root config in webpack to prevent distri…
…bution issues
By using
resolve.root
andmodulesDirectories
overrides with webpack, consuming packages must use webpack and must have a very specific setup in order for Stardust's imports to work correctly. By using all relative paths, Stardust is able to be consumed by any bundler/environment.