Last active
October 25, 2025 07:20
-
-
Save RhysSullivan/92cff93a45d492951e1ff8dea6136c22 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { plugin } from "bun"; | |
| import { transform } from '@swc/core'; | |
| console.log('Workflow plugin loaded'); | |
| plugin({ | |
| name: 'workflow-transform', | |
| setup(build: any) { | |
| build.onLoad({ filter: /workflows\/.*\.(ts|tsx|js|jsx)$/ }, async (args: any) => { | |
| const source = await Bun.file(args.path).text(); | |
| const result = await transform(source, { | |
| filename: args.path, | |
| jsc: { | |
| experimental: { | |
| plugins: [[require.resolve('@workflow/swc-plugin'), { mode: 'client' }]], | |
| }, | |
| }, | |
| }); | |
| return { | |
| contents: result.code, | |
| loader: 'ts', | |
| }; | |
| }); | |
| }, | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment