Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wessberg/rollup-plugin-ts

Package Overview
Dependencies
Maintainers
1
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wessberg/rollup-plugin-ts - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## [1.3.4](https://github.com/wessberg/rollup-plugin-ts/compare/v1.3.3...v1.3.4) (2020-09-02)
### Bug Fixes
- **declarations:** add workaround for TypeScript issue 40361 for older TypeScript versions. Closes [#108](https://github.com/wessberg/rollup-plugin-ts/issues/108) ([659775f](https://github.com/wessberg/rollup-plugin-ts/commit/659775f3f8dc89b0e631be5edfe9110ffd2ece9c))
## [1.3.3](https://github.com/wessberg/rollup-plugin-ts/compare/v1.3.2...v1.3.3) (2020-08-23)

@@ -2,0 +8,0 @@

4

package.json
{
"name": "@wessberg/rollup-plugin-ts",
"version": "1.3.3",
"description": "A Typescript Rollup plugin that bundles declarations and respects Browserslists",
"version": "1.3.4",
"description": "A TypeScript Rollup plugin that bundles declarations and respects Browserslists",
"scripts": {

@@ -6,0 +6,0 @@ "generate:scaffold": "scaffold all --yes",

@@ -9,3 +9,3 @@ <!-- SHADOW_SECTION_LOGO_START -->

> A Typescript Rollup plugin that bundles declarations and respects Browserslists
> A TypeScript Rollup plugin that bundles declarations and respects Browserslists

@@ -102,3 +102,4 @@ <!-- SHADOW_SECTION_DESCRIPTION_SHORT_END -->

- [Ignored/overridden options](#ignoredoverridden-options)
- [Ignored/overridden Typescript options](#ignoredoverridden-typescript-options)
- [Ignored/overridden TypeScript options](#ignoredoverridden-typescript-options)
- [Behavior of esModuleInterop](#behavior-of-esmoduleinterop)
- [Ignored/overridden Babel options](#ignoredoverridden-babel-options)

@@ -112,5 +113,5 @@ - [Default Babel plugins](#default-babel-plugins)

- [Does this plugin work with Code Splitting?](#does-this-plugin-work-with-code-splitting)
- [Why wouldn't you use just Typescript?](#why-wouldnt-you-use-just-typescript)
- [Why wouldn't you use just TypeScript?](#why-wouldnt-you-use-just-typescript)
- [Okay, then why wouldn't you use just babel?](#okay-then-why-wouldnt-you-use-just-babel)
- [When combined with Babel, what does Typescript do, and what does Babel do?](#when-combined-with-babel-what-does-typescript-do-and-what-does-babel-do)
- [When combined with Babel, what does TypeScript do, and what does Babel do?](#when-combined-with-babel-what-does-typescript-do-and-what-does-babel-do)
- [Why is @babel/plugin-transform-runtime and tslib included by default?](#why-is-babelplugin-transform-runtime-and-tslib-included-by-default)

@@ -549,3 +550,3 @@ - [Starter templates](#starter-templates)

Provide the Typescript [CompilerOptions](https://www.typescriptlang.org/docs/handbook/compiler-options.html) to use, or a path to a `tsconfig` with this property.
Provide the TypeScript [CompilerOptions](https://www.typescriptlang.org/docs/handbook/compiler-options.html) to use, or a path to a `tsconfig` with this property.
See [this section](#using-it-with-just-typescript) for details on the many ways this property can be configured.

@@ -576,3 +577,3 @@

Use this property to provide Typescript [`CustomTransformers`](https://github.com/Microsoft/TypeScript/pull/13940).
Use this property to provide TypeScript [`CustomTransformers`](https://github.com/Microsoft/TypeScript/pull/13940).
See [this section](#using-customtransformers) for more details on how to configure this property.

@@ -596,3 +597,3 @@

If this option is `true`, diagnostics won't be generated. This will improve performance since Typescript but ignores all syntactical and semantic errors or warnings that may arise.
If this option is `true`, diagnostics won't be generated. This will improve performance since TypeScript but ignores all syntactical and semantic errors or warnings that may arise.

@@ -610,6 +611,6 @@ #### `fileSystem`

Typescript and Babel are powerful tools in their own right. Combined with Rollup, they become even more powerful.
To provide a seamless experience, Rollup always take precedence when conflicts arise. As a natural consequence of this, some options provided to Typescript and Babel will be ignored or overridden.
TypeScript and Babel are powerful tools in their own right. Combined with Rollup, they become even more powerful.
To provide a seamless experience, Rollup always take precedence when conflicts arise. As a natural consequence of this, some options provided to TypeScript and Babel will be ignored or overridden.
### Ignored/overridden Typescript options
### Ignored/overridden TypeScript options

@@ -620,15 +621,16 @@ The following [CompilerOptions](https://www.typescriptlang.org/docs/handbook/compiler-options.html) from a `tsconfig` will be ignored:

| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `outDir` | Rollup, not Typescript, will decide where to emit chunks. |
| `outDir` | Rollup, not TypeScript, will decide where to emit chunks. |
| `module` | Rollup, not TypeScript, is the decider of which module system(s) to target based on your Rollup configuration. |
| `outFile` | This option produces flat output and only works with the module formats AMD and SystemJS. Rollup will be the decider of how to split code. |
| `sourceMap` | Typescript will always be instructed to produce SourceMaps. Rollup then decides whether or not to include them (and if they should be inlined). |
| `inlineSourceMap` | Typescript will always be instructed to produce SourceMaps. Rollup then decides whether or not to include them (and if they should be inlined). |
| `sourceMap` | TypeScript will always be instructed to produce SourceMaps. Rollup then decides whether or not to include them (and if they should be inlined). |
| `inlineSourceMap` | TypeScript will always be instructed to produce SourceMaps. Rollup then decides whether or not to include them (and if they should be inlined). |
| `inlineSources` | Since `inlineSourceMap` is ignored, this option won't take effect. |
| `importHelpers` | Helpers will always be imported. This makes it possible for Rollup to code-split properly and share Typescript helpers across chunks. |
| `moduleResolution` | Node-module resolution will always be used. This is required for `importHelpers` to work and in general, to make Typescript able to resolve external libraries. Note that you still need to add the [nodeResolve](https://github.com/rollup/rollup-plugin-node-resolve) plugin in order to include external libraries within your bundle unless `allowJs` is `true` within your `tsconfig` |
| `noEmit` | Typescript should always be able to emit assets, but those will be delegated to Rollup. |
| `importHelpers` | Helpers will always be imported. This makes it possible for Rollup to code-split properly and share TypeScript helpers across chunks. |
| `moduleResolution` | Node-module resolution will always be used. This is required for `importHelpers` to work and in general, to make TypeScript able to resolve external libraries. Note that you still need to add the [nodeResolve](https://github.com/rollup/rollup-plugin-node-resolve) plugin in order to include external libraries within your bundle unless `allowJs` is `true` within your `tsconfig` |
| `noEmit` | TypeScript should always be able to emit assets, but those will be delegated to Rollup. |
| `noEmitOnError` | See above. |
| `emitDeclarationOnly` | See above. |
| `noEmitHelpers` | Typescript should always be able to emit helpers, since the `importHelpers` option is forced |
| `noResolve` | Typescript should always be able to resolve things. Otherwise, compilation might break. |
| `watch` | Rollup, not Typescript, will watch files if run in watch mode. Efficient caching will still be used for optimum performance. |
| `emitDeclarationOnly` | See above. | |
| `noEmitHelpers` | TypeScript should always be able to emit helpers, since the `importHelpers` option is forced |
| `noResolve` | TypeScript should always be able to resolve things. Otherwise, compilation might break. |
| `watch` | Rollup, not TypeScript, will watch files if run in watch mode. Efficient caching will still be used for optimum performance. |
| `preserveWatchOutput` | See above |

@@ -643,2 +645,9 @@

#### Behavior of esModuleInterop
Given that Rollup, not TypeScript, is the decider of which module system(s) to target based on your Rollup configuration, TypeScript will always emit ES modules that Rollup can understand and work with.
The `esModuleInterop` option to TypeScript is respected, but its emit-characteristics won't have an impact on your bundle. Instead, you may consult [the Rollup documentation for the `interop` option](https://rollupjs.org/guide/en/#outputinterop) to achieve
the same thing with Rollup.
### Ignored/overridden Babel options

@@ -721,5 +730,5 @@

#### Why wouldn't you use just Typescript?
#### Why wouldn't you use just TypeScript?
The Typescript compiler, while extremely powerful, has the restriction that it can only target a specific ECMAScript version.
The TypeScript compiler, while extremely powerful, has the restriction that it can only target a specific ECMAScript version.
In reality, browsers and other ECMAScript environments has varying support for newer language features.

@@ -729,3 +738,3 @@ Some browsers support even those features that haven't been publicized yet, while others support only parts of the latest language features.

In effect, a browser may support a lot of modern features such as classes and proper lexical scoping, but lack others.
With Typescript, it's _"all-or-nothing"_: If you want to support a Browser with partial support, you must target the latest publicized ECMAScript version that the browser fully supports.
With TypeScript, it's _"all-or-nothing"_: If you want to support a Browser with partial support, you must target the latest publicized ECMAScript version that the browser fully supports.

@@ -738,20 +747,20 @@ Babel, on the other hand, is far more granular in its design and applies syntax transformations on a feature-by-feature basis.

Babel has recently received support for [parsing and transforming Typescript](https://babeljs.io/docs/en/babel-plugin-transform-typescript). It would be intriguing to just use Babel for everything. However, there are significant caveats:
Babel has recently received support for [parsing and transforming TypeScript](https://babeljs.io/docs/en/babel-plugin-transform-typescript). It would be intriguing to just use Babel for everything. However, there are significant caveats:
The Babel compiler works on a file-by-file basis, meaning it is simple to use and reason about, whereas the Typescript compiler works with _Programs_, or in other words sets of related _SourceFiles_.
This gives Typescript the advantage over Babel that it has a greater understanding of your codebase in general and can understand your types across files.
In the context of this plugin, this enables Typescript to do things that you simply wouldn't be able to do with the Typescript plugin for Babel:
The Babel compiler works on a file-by-file basis, meaning it is simple to use and reason about, whereas the TypeScript compiler works with _Programs_, or in other words sets of related _SourceFiles_.
This gives TypeScript the advantage over Babel that it has a greater understanding of your codebase in general and can understand your types across files.
In the context of this plugin, this enables TypeScript to do things that you simply wouldn't be able to do with the TypeScript plugin for Babel:
1. Emit Typescript diagnostics
2. Emit Typescript declaration (`.d.ts`) files and Typescript declaration map (`.d.ts.map`) files.
1. Emit TypeScript diagnostics
2. Emit TypeScript declaration (`.d.ts`) files and TypeScript declaration map (`.d.ts.map`) files.
3. Remove type-only imports that wouldn't otherwise be transformed by Rollup and would lead to issues like [this one](https://github.com/rollup/rollup-plugin-typescript/issues/28)
4. Use `const enums` and all other files that will require type information.
#### When combined with Babel, what does Typescript do, and what does Babel do?
#### When combined with Babel, what does TypeScript do, and what does Babel do?
First, Typescript will be used for:
First, TypeScript will be used for:
1. Reporting diagnostics.
2. Emitting Typescript declaration (`.d.ts`) files and Typescript declaration map (`.d.ts.map`) files.
3. Removing Typescript-specific features such as types, type-only imports, enums, and Typescript decorators.
2. Emitting TypeScript declaration (`.d.ts`) files and TypeScript declaration map (`.d.ts.map`) files.
3. Removing TypeScript-specific features such as types, type-only imports, enums, and TypeScript decorators.

@@ -758,0 +767,0 @@ Babel will then be used for all other syntax transformation from then on, depending on the combination of default, provided, and forced presets and plugins.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc