taskr-swc-alt

1.1.0 • Public • Published

taskr-swc Plugin

taskr-swc is a plugin for Taskr that uses the SWC compiler to transform TypeScript and JavaScript files, providing support for Babel 7, ES6 modules, and TypeScript syntax. This plugin helps optimize build performance by using SWC, a fast alternative to Babel.

Features

  • Transforms TypeScript and JavaScript files using SWC.
  • Supports dynamic imports and JSX/TSX syntax.
  • Configurable for client-side or server-side environments.
  • Provides ES6 module output with loose transpilation options.
  • Strips file extensions or changes .ts/.tsx to .js.
  • Supports source maps with proper file path mapping.

Installation

To install the package, add it to your project using npm or yarn:

npm install taskr-swc-alt
# or
yarn add taskr-swc-alt

Usage

//taskfile.js

export async function build(task, opts) {
  await task
    .source('src/**/*.+(ts|tsx|js)')
    .swc({ dev: opts.dev, outDir: 'dist', baseUrl: 'src' })
    .target('dist')
    .source('src/**/*.+(cjs|json)')
    .target('dist')
  task.$.log('Compiled src files')
}

Readme

Keywords

Package Sidebar

Install

npm i taskr-swc-alt

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

6.41 kB

Total Files

4

Last publish

Collaborators

  • paiman