Skip to content

Commit

Permalink
Fix HMR support for CSS modules (#438)
Browse files Browse the repository at this point in the history
* Fix HMR support for CSS modules

According to [dev.ts#297](https://github.com/pikapkg/snowpack/blob/62a00e857aec3101e359dfebf00c3d25ce9fbc83/src/commands/dev.ts#L297), `'.proxy.js'` shouldn't get appended to CSS module files. With this fix in place, HMR is working for CSS modules.

* remove unnecessary space
  • Loading branch information
stephtr committed Jun 8, 2020
1 parent 62a00e8 commit 4ebb6c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/dev.ts
Expand Up @@ -825,7 +825,7 @@ export async function command(commandOptions: CommandOptions) {
async function onWatchEvent(fileLoc) {
let updateUrl = getUrlFromFile(mountedDirectories, fileLoc);
if (updateUrl) {
if (!updateUrl.endsWith('.js')) {
if (!updateUrl.endsWith('.js') && !updateUrl.endsWith('.module.css')) {
updateUrl += '.proxy.js';
}
if (isLiveReloadPaused) {
Expand Down

0 comments on commit 4ebb6c8

Please sign in to comment.