webpack --watch ignores changes in files that only export TS interfaces
See original GitHub issueBug 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:
- Created 5 years ago
- Reactions:8
- Comments:7 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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…
Issue was closed because of inactivity.
If you think this is still a valid issue, please file a new issue with additional information.