-
-
Notifications
You must be signed in to change notification settings - Fork 431
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 does not recompile non-.d.ts type definitions #808
Comments
I've found a workaround to this issue by using Ambient type definitions are still not reloading on save ( issue being tracked here TypeStrong/fork-ts-checker-webpack-plugin#36 ), but it does not 'persist' across incremental builds anymore. |
@liangchunn we have the same issue but pure type definition files are not recompiling - The issue you referenced is exactly about this. Do you have a fix? Would you mind sharing your setup? |
@FranzSkuffka AFAIK pure Here's my configuration for reference: https://github.com/liangchunn/typescript-node-scripts/blob/master/lib/webpack.config.dev.js Viel Glück! |
I have encountered the same problem. The reason for this problem is not just a pure types file, but a ts file that is not actually used. That is, only This problem can be solved by Don't worry. The webpack production mode can removes empty modules and tree shaking. This won't have extra code being packaged. 😄 my casetype.ts export interface InterfaceA {
a1: number;
a2: string;
}
export function test() {
console.log('test');
} index.ts import { InterfaceA } from './type';
// import './type';
export function app(value: InterfaceA) {
console.log(value.a1.toFixed(0));
console.log(value.a2.trim());
} |
Shouldn't there be a solution to this problem that isn't just a workaround? Is it even possible? |
Webpack does not detect changes made to a pure types file in
--watch
mode on incremental builds.I have been struggling with this issue; it's somehow related to #697, but with non-
.d.ts
files.After starting webpack in watch mode, removing
b: string
fromtypes.ts
and saving, no errors are emitted.Expected Behaviour
Webpack recompiles non-
.d.ts
type definitionsActual Behaviour
Webpack does not detect changes in
types.ts
on incremental builds, but fails on a cold build.Steps to Reproduce the Problem
git clone https://github.com/liangchunn/not-recompiling-ts.git
cd not-recompiling-ts
yarn install
yarn start
b: string
in src/types.ts and saveLocation of a Minimal Repository that Demonstrates the Issue.
https://github.com/liangchunn/not-recompiling-ts
Dependency versions
webpack@4.12.0
ts-loader@4.4.1
typescript@2.9.2
webpack.config.json
https://github.com/liangchunn/typescript-node-scripts/blob/master/lib/webpack.config.dev.js
The text was updated successfully, but these errors were encountered: