1.1.0 • Published 9 months ago

taskr-swc-alt v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

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')
}
1.1.0

9 months ago

1.0.0

9 months ago

0.0.2

9 months ago