unplugin-sucrase
v0.2.1
Published
A universal bundler plugin which compiles TypeScript, Flow, JSX, etc with Sucrase.
Downloads
3
Maintainers
Readme
unplugin-sucrase
🍣 A universal bundler plugin which compiles TypeScript, Flow, JSX, etc with Sucrase.
Install
npm i unplugin-sucrase
// vite.config.ts
import UnpluginSucrase from 'unplugin-sucrase/vite'
export default defineConfig({
plugins: [
UnpluginSucrase({
/* options */
}),
],
})
Example: playground/
// rollup.config.js
import UnpluginSucrase from 'unplugin-sucrase/rollup'
export default {
plugins: [
UnpluginSucrase({
/* options */
}),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-sucrase/webpack')({
/* options */
}),
],
}
// nuxt.config.js
export default defineNuxtConfig({
modules: [
[
'unplugin-sucrase/nuxt',
{
/* options */
},
],
],
})
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-sucrase/webpack')({
/* options */
}),
],
},
}
// esbuild.config.js
import { build } from 'esbuild'
import UnpluginSucrase from 'unplugin-sucrase/esbuild'
build({
plugins: [UnpluginSucrase()],
})
Usage
Options
For all options please refer to docs.
This plugin accepts all @rollup/plugin-sucrase options.