包详细信息

rollup-plugin-sucrase

rollup8.6kLIL不推荐使用2.1.0

This package has been deprecated and is no longer maintained. Please use @rollup/plugin-sucrase.

Compile TypeScript, Flow, JSX etc with Sucrase

sucrase, typescript, flow, jsx

自述文件

rollup-plugin-sucrase

Use Sucrase with Rollup.

Installation

yarn add -D rollup-plugin-sucrase

Usage

An example of compiling TypeScript (the node-resolve plugin is added to automatically add file extensions, since TypeScript expects not to find them):

// rollup.config.js
import sucrase from 'rollup-plugin-sucrase';
import resolve from 'rollup-plugin-node-resolve';

export default {
  input: 'src/index.ts',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs'
  },
  plugins: [
    resolve({
       extensions: ['.js', '.ts' ]
    }),
     sucrase({
      exclude: ['node_modules/**'],
      transforms: ['typescript']
    })
  ]
}

License

LIL.

更新日志

rollup-plugin-sucrase changelog

2.1.0

  • Add filter option (#4)
  • Remove lockfile so we always get most recent version of Sucrase
  • Resolve extensionless imports (#3)

2.0.0

  • Update to Sucrase 3.x (#2)

1.0.0

  • First release