sdk-typescript
sdk-typescript copied to clipboard
Bundle using Vite
I am sure you are already familiar with Vite https://vitejs.dev/
Webpack is great, but it is pretty slow and waiting 10 seconds for bundle to complete can become a nuisance.
It would be really nice to be able to bundle using Vite.
I'm using esbuild and building for production only takes 0.6s (workflows.js and worker.js), no need to use the built-in webpack bundling. For dev/watch mode, I'm using https://github.com/esbuild-kit/tsx.
I agree it would be cool if temporal moved to a faster build-in bundler (vite or esbuild). Think cloudflare wrangler and aws sdk have gone for esbuild by default.
I'm using esbuild and building for production only takes 0.6s (workflows.js and worker.js), no need to use the built-in webpack bundling.
Can you elaborate how?
Build script js file building index.js and workflows.js via esbuild https://gist.github.com/bkniffler/9fe91f6a1a8ba05f1eeb993441c7cdb5
Dev NPM script using tsx to run worker
NODE_NO_WARNINGS=1 tsx watch src/index.ts
If I've some time, I'd be happy to provide a simple sample project.
@bkniffler If you have time to create a sample project, I would definitely appreciate it.
@bkniffler AFAICT you still need the sdk’s webpack bundler after you generate your js bundle with esbuild. How are you instantiating your worker?