Bun bundle html and typescript #5358
-
It's a basic parcel use case, can bun do this? <!-- index.html -->
<html>
<body>
<script src="./index.ts"></script>
</body>
</html> // index.ts
import message from './message'
console.log(message) // message.ts
export default 'Hello, world' |
Beta Was this translation helpful? Give feedback.
Answered by
kravetsone
Jan 11, 2025
Replies: 1 comment 3 replies
-
I have the same question. I'm trying to do the same thing, with a file structure that looks like this: and when I run Bun.build({
entrypoints: ['./demo/minimaldemo.html'],
outdir: './builtDemo',
naming: {
// default values
entry: '[dir]/[name].[ext]',
chunk: '[name]-[hash].[ext]',
asset: '[dir]/[name]-[hash][ext]',
},
}) It acts weird, deciding that the // demo/minimaldemo.html
var minimaldemo_default = "./minimaldemo-a02eb42fdf5d8158html";
export {
minimaldemo_default as default
}; I'd expect it to transform the TypeScript into JavaScript and then change the file extension in the html. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use --experimental-html