Created
February 4, 2022 21:43
-
-
Save mbrowne/4497fe8827c6267bda3b9a8133d2e1c9 to your computer and use it in GitHub Desktop.
Simple rollup config for compiling TypeScript with swc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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