Skip to content

Instantly share code, notes, and snippets.

@mbrowne
Created February 4, 2022 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbrowne/4497fe8827c6267bda3b9a8133d2e1c9 to your computer and use it in GitHub Desktop.
Save mbrowne/4497fe8827c6267bda3b9a8133d2e1c9 to your computer and use it in GitHub Desktop.
Simple rollup config for compiling TypeScript with swc
import autoExternal from 'rollup-plugin-auto-external'
import json from '@rollup/plugin-json'
import ts from 'rollup-plugin-ts'
export default {
input: ['src/index.ts'],
plugins: [
// allow .json files to be imported
json(),
ts({
transpiler: 'swc',
}),
autoExternal(),
],
output: [
{
dir: 'build',
format: 'cjs',
sourcemap: true,
},
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment