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

@rollup/plugin-typescript

Package Overview
Dependencies
Maintainers
4
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rollup/plugin-typescript - npm Package Compare versions

Comparing version 8.2.3 to 8.2.4

8

CHANGELOG.md
# @rollup/plugin-typescript ChangeLog
## v8.2.4
_2021-07-29_
### Updates
- docs: declaration file output to same directory. fixes #934 (702c855)
## v8.2.3

@@ -4,0 +12,0 @@

15

package.json
{
"name": "@rollup/plugin-typescript",
"version": "8.2.3",
"version": "8.2.4",
"publishConfig": {

@@ -23,10 +23,11 @@ "access": "public"

"build": "rollup -c",
"ci:coverage": "nyc pnpm run test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:lint": "pnpm run build && pnpm run lint",
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
"ci:lint": "pnpm build && pnpm lint",
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "pnpm run test -- --verbose --serial",
"ci:test": "pnpm test -- --verbose --serial",
"prebuild": "del-cli dist",
"prepare": "pnpm run build",
"prepublishOnly": "pnpm -w run lint",
"pretest": "pnpm run build",
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
"prerelease": "pnpm build",
"pretest": "pnpm build",
"release": "pnpm plugin:release --workspace-root -- --pkg $npm_package_name",
"test": "ava",

@@ -33,0 +34,0 @@ "test:ts": "tsc --noEmit"

@@ -157,3 +157,3 @@ [npm]: https://img.shields.io/npm/v/@rollup/plugin-typescript

type: 'program',
factory: program => {
factory: (program) => {
return ProgramRequiringTransformerFactory(program);

@@ -164,3 +164,3 @@ }

type: 'typeChecker',
factory: typeChecker => {
factory: (typeChecker) => {
// Allow the transformer to get a Program reference in it's factory

@@ -284,2 +284,50 @@ return TypeCheckerRequiringTransformerFactory(program);

### Declaration Output With `output.file`
When instructing Rollup to output a specific file name via the `output.file` Rollup configuration, and TypeScript to output declaration files, users may encounter a situation where the declarations are nested improperly. And additionally when attempting to fix the improper nesting via use of `outDir` or `declarationDir` result in further TypeScript errors.
Consider the following `rollup.config.js` file:
```js
import typescript from '@rollup/plugin-typescript';
export default {
input: 'src/index.ts',
output: {
file: 'dist/index.mjs'
},
plugins: [typescript({ tsconfig: './tsconfig.json' })]
};
```
And accompanying `tsconfig.json` file:
```json
{
"include": ["*"],
"compilerOptions": {
"outDir": "dist",
"declaration": true
}
}
```
This setup will produce `dist/index.mjs` and `dist/dist/index.d.ts`. To correctly place the declaration file, add an `exclude` setting in `tsconfig` and modify the `declarationDir` setting in `compilerOptions` to resemble:
```json
{
"include": ["*"],
"exclude": ["dist"],
"compilerOptions": {
"outDir": "dist",
"declaration": true,
"declarationDir": "."
}
}
```
This will result in the correct output of `dist/index.mjs` and `dist/index.d.ts`.
_For reference, please see the workaround this section is based on [here](https://github.com/microsoft/bistring/commit/7e57116c812ae2c01f383c234f3b447f733b5d0c)_
## Meta

@@ -286,0 +334,0 @@

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