intuit / postcss-themed

A PostCSS plugin for generating themes.
MIT License
62 stars 32 forks source link

Hot Reloading: Include Extension in Theme File Path #44

Closed tylerkrupicka closed 3 years ago

tylerkrupicka commented 3 years ago

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, the getThemeFilename function was returning the filename without an extension.

my-ds/components/Component/src/theme

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 default ts and js extensions, and my hot reloading started working. I'll test the change here with a canary.

Todo:

Published PR with canary version: 2.4.1-canary.44.566

tylerkrupicka commented 3 years ago

This change is tested and working in my design system project.

hipstersmoothie commented 3 years ago

:rocket: PR was released in v2.4.1 :rocket: