Hot Reloading: Include Extension in Theme File Path #44
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.
What Changed
I changed the
getThemeFilename
function to include a file extension which was needed for hot reloading.Why
There was recently a change to add the theme file as a dependency for hot reloading. I was having trouble getting this working in a design system and started debugging what was going on. What I found was the hot reloading logic used
getThemeFilename
to add the theme file as a dependency. However, thegetThemeFilename
function was returning the filename without an extension.I think this works in other parts of the project because
require
figures out the extension.I edited node_modules and changed
getThemeFilename
to test for our defaultts
andjs
extensions, and my hot reloading started working. I'll test the change here with a canary.Todo:
yarn all-contributors add [name] [type]
) see https://github.com/all-contributors/all-contributors/blob/master/docs/cli/usage.mdPublished PR with canary version:
2.4.1-canary.44.566