一覧へ戻る
db-developer/rollup-plugin-yatsc(新しいタブで開きます)
主要言語: JavaScript
yet another rollup plugin for typescript
- star 数
- 2
- watcher 数
- 1
- fork 数
- 0
- issue 数
- 1
- 最終更新
- 2026/02/28
主要言語: JavaScript
yet another rollup plugin for typescript
Yet another Rollup plugin for transpiling Typescript.
This project is a fork of rollup-plugin-tsc v 1.1.15 (MIT). Thanks to tsne (Thomas Nitsche) for the work on his project on which the adjustments for this plugin are based.
rollup-plugin-yatsc aims to be callable by grunt and provides the option to pass in tsconfig by pojo as well as by filename.
npm install --save-dev rollup-plugin-yatsc
// rollup.config.js import yatsc from "rollup-plugin-yatsc"; export pojodefault { input: "src/main.ts", plugins: [ yatsc({ // put your tsconfig here }), ] }; export filedefault { input: "src/main.ts", plugins: [ yatsc("build/tsconfig.es5.json"), ] };
To configure the Typescript compiler, a tsconfig has to be passed to the plugin. This can either be by providing a plain old javascript object or by specifying a path/to/tsconfig.json.
// gruntfile.js const yatsc = require( "rollup-plugin-yatsc" ); module.exports = function( grunt ) { let pkgjson = grunt.file.readJSON( "package.json" ); let scope = pkgjson.name.slice( 0, pkgjson.name.indexOf("/")).replace( "@", "" ); let pkgname = pkgjson.name.slice( pkgjson.name.indexOf("/") + 1 ); let pkglobl = scope ? `${ scope }.${ pkgname }` : pkgname; grunt.initConfig({ rollup: { esm5: { src : "build/public-api.ts", dest : `dist/${ pkgname }/esm5/${ pkglobl }.js`, options: { plugins : [ yatsc( `${ BUILD }/tsconfig.esm5.json` )], name : `${ pkglobl }`, format : "esm", sourcemap : "inline" } } }, // ... }); grunt.loadNpmTasks( "grunt-rollup" ); grunt.registerTask( "default", [ "rollup" ]); };