@tsrx/bun-plugin-vue
v0.0.89
Published
Bun plugin for @tsrx/vue (.tsrx modules)
Keywords
Readme
@tsrx/bun-plugin-vue
Bun plugin for compiling @tsrx/vue .tsrx files.
Installation
pnpm add -D @tsrx/bun-plugin-vueUsage
import tsrxVue from '@tsrx/bun-plugin-vue';
await Bun.build({
entrypoints: ['./src/App.tsrx'],
outdir: './dist',
target: 'browser',
plugins: [tsrxVue()],
});The plugin compiles .tsrx modules with @tsrx/vue, runs the downstream
vue-jsx-vapor transform, strips the remaining TypeScript syntax with Bun, and
emits sibling-scoped <style> blocks (each styles its siblings and everything
below them) as virtual CSS modules.
For bun:test, register it from a preload:
import tsrxVue from '@tsrx/bun-plugin-vue';
Bun.plugin(tsrxVue());Options
vapor: options forwarded tovue-jsx-vapor.runtimeImports: helper import mode ('compiler'by default, or'direct'for standalone runtime imports).platform: optional override/fallback for the compile-time platform. Normally the plugin readstsrx.platformfrom Bun's selected/nearest tsconfig, includingextends. An override must match tsconfig. ForBun.build, all three exact flags are defined and conflicting definitions are rejected.emitCss: whether to emit virtual CSS imports (default:true).include,exclude: regex filters for source files.
When using runtimeImports: 'direct', install the runtime as a direct production
dependency of the package that owns the compiled modules:
pnpm add @tsrx/vue-runtimeBun may bundle the helpers into its output, but this plugin only emits bare
@tsrx/vue-runtime/* imports and does not provide the runtime package.
