Replies: 3 comments
-
|
I'm having the same problem. Have you found anything? |
Beta Was this translation helpful? Give feedback.
-
|
You can combine bun build with copying the |
Beta Was this translation helpful? Give feedback.
-
|
bun build no tiene un equivalente de public directory como vite, pero puedes copiarlo manualmente en el script de build. en package.json algo asi: {
"scripts": {
"build": "bun build ./src/index.ts --outdir ./dist && cp -r ./public ./dist/public"
}
}o si quieres algo mas elaborado puedes usar el plugin system de bun para copiar archivos al final del build. pero la verdad para la mayoria de casos el cp en el script es lo mas simple y funciona igual de bien. si estas en windows cambia cp -r por xcopy o usa un script en js que copie la carpeta |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, I use Vite to build my library and looking forward to switching to Bun.
In Vite I have a
srcdirectory with code and assets needs to be bundled/minified and alsopublicdirectory for static assets: css, images, fonts and some json files that should not be transformed in any way and copied into build as-is.But after glancing at Bun docs, I cannot find any equivalent of
publicDirconfig parameter. How can I handle static assets with Bun.Build?Vite docs reference: https://vitejs.dev/config/shared-options.html#publicdir
Beta Was this translation helpful? Give feedback.
All reactions