fix: support win32 paths when transforming compiled code#6
Merged
christian-bromann merged 1 commit intostencil-community:mainfrom Jun 11, 2025
Merged
Conversation
Member
|
Thanks for the contribution! Anything missing for this to be ready for review? |
Contributor
Author
|
Just missing working unit tests, I couldn't mock the platform for |
7729e31 to
a64a94e
Compare
|
I can confirm this fixes the issue on windows, thanks a lot @acerspyro |
a64a94e to
ec95805
Compare
Contributor
Author
|
Nice, looks like the pipeline is passing! I'm testing a local build with a colleague, it should be good to merge after if you're satisfied with it :) |
christian-bromann
approved these changes
Jun 11, 2025
Member
christian-bromann
left a comment
There was a problem hiding this comment.
Great contribution 👏 thanks a lot!
Contributor
Author
|
I can confirm that it works on our end! @christian-bromann thank you! |
Member
|
Thank YOU! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I encountered a critical bug on Windows where import paths are parsed very wrong when being processed.
This means anyone using stencil + storybook on Windows will get an import error when loading the component in Storybook
Essentially,
transformCompiledCode()would replace "./index.js" in, for example,dist/components/my-component.jswith:/Users/veryloud/Projects/my-project/C:UsersveryloudProjectsmy-projectdistcomponents/index.jsThis fix makes sure the path method that is correct for the user's system is used.