-
-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webpack --watch do not detect changes in files that only export TS interfaces/types etc. #1138
Comments
@jbrantly it turn out it is my lack of Webpack and ts-loader knowledges I just need to include "importsNotUsedAsValues": "preserve" option to the compiler options in the tsconfig.json. https://www.npmjs.com/package/fork-ts-checker-webpack-plugin#type-only-modules-watching Please close this Issue if needed! Thanks |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing as stale. Please reopen if you'd like to work on this further. |
Bug report
What is the current behavior?
I believe this issue has been reported in a closed issue (webpack/webpack#8734)
therefore, report again for visibility:
When the only thing a Typescript file exports is an interface, changes to the interface are not seen by watch
I believe files only contain interfaces contain no real Javascript and that is the issue that webpack is not able to detect any changes while transpilation.
Tried the workaround with comments that didn't fix the issue, the only way I were able to get the
type only
file trigger the build is to have aexport { a: 'a' }
thenimport { a } from './typeOnly.ts'
- which is not ideal and not practical.If the current behavior is a bug, please provide the steps to reproduce.
Create a file that only export interface/types:
props.ts
Then create anther file that import
props.ts
:component.ts
Modify
props.ts
, either add/change/delete properties inProps
then apply those changes tocomponent.ts
Webpack not able to detect the changes in
props.ts
and thetype errors
report error on the UI.See screenshot attached below for example:
https://github.com/kenilam/Ki.CL is my repos where you can reproduce.
What is the expected behavior?
Webpack watch should be able to pick up file changes that only contain
type
valuesOther relevant information:
webpack version: 4.43.0
Node.js version: 14.4.0
This issue was moved from webpack/webpack#11121 by @sokra. Original issue was by @kenilam.
The text was updated successfully, but these errors were encountered: