question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webpack --watch ignores changes in files that only export TS interfaces

See original GitHub issue

Bug report

What is the current behavior? When the only thing a Typescript file exports is an interface, changes to the interface are not seen by webpack --watch.

If the current behavior is a bug, please provide the steps to reproduce. I have created a very small example repository to reproduce the issue including instructions in the README file: https://github.com/chmielot/webpackwatch-bug

What is the expected behavior? If a Typescript file only exports interfaces, changes to the interfaces should also force a recompile.

Other relevant information: webpack version: 4.29.1 Node.js version: v11.8.0 Operating System: macOS Mojave 10.14.2 Additional tools: -

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
chmielotcommented, Feb 15, 2019

@johnnyreilly , you say that a file that contains only interfaces is an empty file after transpilation. For a better understanding, can you explain why it recompiles when changing the interface, when there is a function defined and used, like in my example? According to what you said, the output post transpilation should still be the same.

And to discuss your idea for a solution: Couldn’t we just add a commented to hash to every file in dev mode? I’m not an expert to tell if it is easy or not to identify a file with only interfaces…

0reactions
webpack-botcommented, Nov 24, 2019

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack & typescript: watch not working for exported intefaces
I encountered a similar issue. What solved it for me was to change the filenames of files that contain only interfaces from *.ts...
Read more >
Watch and WatchOptions | webpack
Webpack can watch files and recompile whenever they change. This page explains how to enable this and a couple of tweaks you can...
Read more >
rollup.js
Command Line Interface ... ES modules export live bindings, not values, so values can be changed after they ... Error — only incrementer.js...
Read more >
Configuring Jest
The configuration file should simply export an object: JavaScript; TypeScript. /** @type {import('jest').Config} */
Read more >
Documentation - tsc CLI Options - TypeScript
Flag Type Default ‑‑allowJs boolean false ‑‑allowUmdGlobalAccess boolean false ‑‑allowUnreachableCode boolean
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found