-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed as not planned
Closed as not planned
Copy link
Labels
ExternalRelates to another program, environment, or user action which we cannot control.Relates to another program, environment, or user action which we cannot control.
Milestone
Description
π Search Terms
"module augmentation" tree-shaking
π Version & Regression Information
- I was unable to test this on prior versions because: I'm using the satisfies keyword
β― Playground Link
https://github.com/jesscss/jess/blob/dev-freeze/packages/css-parser/src/cssParser.ts#L2
π» Code
// chevrotain.d.ts
declare module 'chevrotain' {
interface CstParser {
// things that augment this type
}
}
// cssParser.ts
import { CstParser, EOF } from 'chevrotain'
class CssParser extends CstParser {
// class implementation
}
// outputs
import { EOF } from 'chevrotain'π Actual behavior
Augmenting the module seems to remove it from being considered "used" when compiling.
π Expected behavior
Augmenting the module should have no effect on tree-shaking imports.
Additional information about the issue
I thought maybe this was an expected behavior, and I'd just never encountered it before? But I could find nothing in TypeScript documentation about this.
Also, interestingly, the import is not tree-shaken from the exported .d.ts file, only the .js file. π€·ββοΈ
Metadata
Metadata
Assignees
Labels
ExternalRelates to another program, environment, or user action which we cannot control.Relates to another program, environment, or user action which we cannot control.