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

Seamless integration between Rollup and TypeScript.

  • 11.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
731K
decreased by-4.17%
Maintainers
4
Weekly downloads
 
Created

What is @rollup/plugin-typescript?

@rollup/plugin-typescript is a Rollup plugin that allows you to seamlessly integrate TypeScript into your Rollup build process. It compiles TypeScript files and includes them in your bundle, making it easier to work with TypeScript in a Rollup-based project.

What are @rollup/plugin-typescript's main functionalities?

Basic TypeScript Compilation

This feature allows you to compile TypeScript files into JavaScript. The code sample demonstrates a basic Rollup configuration that compiles a TypeScript file located at 'src/index.ts' and outputs a bundled JavaScript file at 'dist/bundle.js'.

const typescript = require('@rollup/plugin-typescript');

module.exports = {
  input: 'src/index.ts',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs'
  },
  plugins: [
    typescript()
  ]
};

Custom TypeScript Compiler Options

This feature allows you to specify custom TypeScript compiler options by providing a path to a custom tsconfig.json file. The code sample shows how to use a custom TypeScript configuration file named 'tsconfig.custom.json'.

const typescript = require('@rollup/plugin-typescript');

module.exports = {
  input: 'src/index.ts',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs'
  },
  plugins: [
    typescript({
      tsconfig: 'tsconfig.custom.json'
    })
  ]
};

Type Checking

This feature enables type checking during the build process. The code sample demonstrates how to enable type checking by setting the 'check' option to true.

const typescript = require('@rollup/plugin-typescript');

module.exports = {
  input: 'src/index.ts',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs'
  },
  plugins: [
    typescript({
      check: true
    })
  ]
};

Other packages similar to @rollup/plugin-typescript

Keywords

FAQs

Package last updated on 12 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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