Malekai
Malekai

Reputation: 5011

How do I get TypeScript to ignore imports?

Let's say I have the following TypeScript file:

import { X, Y, Z } from "./abc";

console.log("Done!");

How do I get TypeScript to ignore the import statement (I.E: remove it) so the compiled result looks like this:

console.log("Done!");

Upvotes: 2

Views: 14342

Answers (1)

Yash Vekaria
Yash Vekaria

Reputation: 2373

Create a global.d.ts and add

declare module '*';

It automatically makes all js modules any while ts modules keep working as intended.

Now you are free to import any js modules without typings!

Upvotes: 13

Related Questions