Skip to content

Commit f56c91c

Browse files
committed
fix: regression in v2.0.3 on TypeScript <= 3.7 where ExportDeclarations could be dropped
1 parent 78bb9a1 commit f56c91c

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ One of the most powerful features of `rollup-plugin-ts` is declaration bundling
3434

3535
Tooling in the JavaScript ecosystem can often be complex, and this is very much the case when intending to combine TypeScript with other tools such as Babel and Browserslists while still maintaining the [unique emit capabilities of `tsc`](https://github.com/rollup/rollup-plugin-typescript/issues/28). `rollup-plugin-ts` differs from other TypeScript plugins in being opiniated about how some of these tools integrate in order to achieve the most optimal behavior with the smallest possible computational overhead. For example, when combined with another transpiler such as Babel, TypeScript handles diagnostics, declarations, and stripping away types, while Babel is used for syntax transformations.
3636

37+
At the same time, `rollup-plugin-ts` has a very robust test suite that runs tests across all minor versions of TypeScript since v3.4 to ensure that everything works no matter which version of TypeScript you or your team is using.
38+
3739
<!-- SHADOW_SECTION_FEATURES_START -->
3840

3941
### Features
@@ -47,6 +49,7 @@ Tooling in the JavaScript ecosystem can often be complex, and this is very much
4749
- Correctly handles [Emit-less types](https://github.com/rollup/rollup-plugin-typescript/issues/28)
4850
- Supports Incremental compilation.
4951
- A [Browserslist](https://github.com/browserslist/browserslist) can be provided instead of a target version of ECMAScript such that your code is transpiled in relation to the baseline of browsers defined in your Browserslist instead.
52+
- Robust, with a comprehensive test suite that runs against all minor versions of TypeScript from v3.4 and up.
5053

5154
<!-- SHADOW_SECTION_FEATURE_IMAGE_START -->
5255

src/service/transformer/declaration-bundler/util/get-merged-export-declarations-for-modules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function getMergedExportDeclarationsForModules(options: GetMergedExportDe
6262
}
6363

6464
for (const exportDeclaration of exports) {
65-
if (exportDeclaration.isTypeOnly !== isTypeOnly) continue;
65+
if (Boolean(exportDeclaration.isTypeOnly) !== Boolean(isTypeOnly)) continue;
6666

6767
// If the ModuleSpecifier is given and it isn't a string literal, leave it as it is
6868
if (exportDeclaration.moduleSpecifier != null && !typescript.isStringLiteralLike(exportDeclaration.moduleSpecifier)) {

test/type-reference-directive.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ test.serial("Detects type reference directives and respects tree-shaking and cod
2828
const {
2929
declarations: [file]
3030
} = bundle;
31+
3132
t.deepEqual(
3233
formatCode(file.code),
3334
formatCode(`\

0 commit comments

Comments
 (0)