{"id":13527743,"url":"https://github.com/rollup/rollup-plugin-typescript","last_synced_at":"2025-04-01T09:32:01.343Z","repository":{"id":57398872,"uuid":"45854411","full_name":"rollup/rollup-plugin-typescript","owner":"rollup","description":"This module has moved and is now available at @rollup/plugin-typescript / https://github.com/rollup/plugins/blob/master/packages/typescript","archived":true,"fork":false,"pushed_at":"2019-12-03T00:11:37.000Z","size":214,"stargazers_count":325,"open_issues_count":0,"forks_count":61,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-05-02T05:43:23.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rollup.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-09T17:29:04.000Z","updated_at":"2024-02-04T01:53:41.000Z","dependencies_parsed_at":"2022-09-12T05:00:14.554Z","dependency_job_id":null,"html_url":"https://github.com/rollup/rollup-plugin-typescript","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rollup","download_url":"https://codeload.github.com/rollup/rollup-plugin-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246616376,"owners_count":20806123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:59.443Z","updated_at":"2025-04-01T09:32:00.630Z","avatar_url":"https://github.com/rollup.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Moved\n\nThis module has moved and is now available at [@rollup/plugin-typescript](https://github.com/rollup/plugins). Please update your dependencies. This repository is no longer maintained.\n\n\n# rollup-plugin-typescript\n[![Build Status](https://travis-ci.org/rollup/rollup-plugin-typescript.svg?branch=master)](https://travis-ci.org/rollup/rollup-plugin-typescript)\n![npm-version](https://img.shields.io/npm/v/rollup-plugin-typescript.svg?maxAge=2592000)\n![npm-monthly-downloads](https://img.shields.io/npm/dm/rollup-plugin-typescript.svg?maxAge=2592000)\n![npm-dependencies](https://img.shields.io/david/rollup/rollup-plugin-typescript.svg?maxAge=2592000)\n\nSeamless integration between Rollup and Typescript.\n\n## Why?\nSee [rollup-plugin-babel](https://github.com/rollup/rollup-plugin-babel).\n\n## Installation\n\n```bash\nnpm install --save-dev rollup-plugin-typescript typescript tslib\n```\n\nNote that both `typescript` and `tslib` are peer dependencies of this plugin that need to be installed separately.\n\n## Usage\n\n```js\n// rollup.config.js\nimport typescript from 'rollup-plugin-typescript';\n\nexport default {\n  input: './main.ts',\n  plugins: [\n    typescript()\n  ]\n}\n```\n\nThe plugin loads any [`compilerOptions`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) from the `tsconfig.json` file by default. Passing options to the plugin directly overrides those options:\n\n```js\n...\nexport default {\n  input: './main.ts',\n  plugins: [\n      typescript({lib: [\"es5\", \"es6\", \"dom\"], target: \"es5\"})\n  ]\n}\n```\n\nThe following options are unique to `rollup-plugin-typescript`:\n\n* `options.include` and `options.exclude` (each a minimatch pattern, or array of minimatch patterns), which determine which files are transpiled by Typescript (all `.ts` and `.tsx` files by default).\n\n* `tsconfig` when set to false, ignores any options specified in the config file. If set to a string that corresponds to a file path, the specified file will be used as config file.\n\n* `typescript` overrides TypeScript used for transpilation:\n  ```js\n  typescript({\n    typescript: require('some-fork-of-typescript')\n  })\n  ```\n\n* `tslib` overrides the injected TypeScript helpers with a custom version\n  ```js\n  typescript({\n    tslib: require('some-fork-of-tslib')\n  })\n  ```\n\n### TypeScript version\nDue to the use of `tslib` to inject helpers, this plugin requires at least [TypeScript 2.1](https://github.com/Microsoft/TypeScript/wiki/Roadmap#21-december-2016). See also [here](https://blog.mariusschulz.com/2016/12/16/typescript-2-1-external-helpers-library#the-importhelpers-flag-and-tslib).\n\n### Importing CommonJS\nThough it is not recommended, it is possible to configure this plugin to handle imports of CommonJS files from TypeScript. For this, you need to specify `CommonJS` as the module format and add `rollup-plugin-commonjs` to transpile the CommonJS output generated by TypeScript to ES Modules so that rollup can process it.\n\n```js\n// rollup.config.js\nimport typescript from 'rollup-plugin-typescript';\nimport commonjs from 'rollup-plugin-commonjs';\n\nexport default {\n  input: './main.ts',\n  plugins: [\n    typescript({module: 'CommonJS'}),\n    commonjs({extensions: ['.js', '.ts']}) // the \".ts\" extension is required\n  ]\n}\n```\n\nNote that this will often result in less optimal output.\n\n## Issues\nThis plugin will currently **not warn for any type violations**. This plugin relies on TypeScript's [transpileModule](https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function) function which basically transpiles TypeScript to JavaScript by stripping any type information on a per-file basis. While this is faster than using the language service, no cross-file type checks are possible with this approach.\n\nThis also causes issues with emit-less types, see [#28](https://github.com/rollup/rollup-plugin-typescript/issues/28).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollup%2Frollup-plugin-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frollup%2Frollup-plugin-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollup%2Frollup-plugin-typescript/lists"}