Skip to content

Commit

Permalink
add check to only transform js file imports
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Jun 10, 2020
1 parent 9206b1b commit 58dba0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ export async function command(commandOptions: CommandOptions) {
if (responseFileExt === '.js' && cssResource) {
code = `import './${path.basename(reqPath).replace(/.js$/, '.css.proxy.js')}';\n` + code;
}
if (reqUrlHmrParam) {
if (responseFileExt === '.js' && reqUrlHmrParam) {
code = await transformEsmImports(code as string, (imp) => {
const importUrl = path.posix.resolve(path.posix.dirname(reqPath), imp);
const node = hmrEngine.getEntry(importUrl);
Expand Down

0 comments on commit 58dba0e

Please sign in to comment.