Open Klohto opened 1 year ago
I absolutely agree, html entry files are very common, and many bundlers support them as entry points.
This is one of my favorite features of Parcel, along with hot module replacement.
It would also be really neat to integrate a Parcel-like dev server into Bun.serve()
so you could just start your backend and frontend dev server together.
In the meantime, I created an extension of the Bun bundler which is able to accept HTML files as entry points. Additionally, it can compile typescript files that are added in, to javascript automatically.
There still might be a few bugs here and there, but here is the GitHub link for bun-plugin-html. Feel free to leave bugs/enhancements in the issues tab.
In the meantime, I created an extension of the Bun bundler which is able to accept HTML files as entry points. Additionally, it can compile typescript files that are added in, to javascript automatically.
There still might be a few bugs here and there, but here is the GitHub link for bun-plugin-html. Feel free to leave bugs/enhancements in the issues tab.
Fantastic, great job!
I filed #1365, which is somewhat related to this. It's weird how bun index.html
returns error: file not found "index.html"
.
It would be great if bun could do something more similar to Parcel here.
I though this was supported since Parcel is mentioned in the benchmarks,
150x faster than Parcel
I just got rid of my .parcelrc
file and discovered it wasn't 😆
Yeah I just wanted to join the cause and add my little "+1" although I would be completely unable to help in such a PR
That's a bummer, I would like to compile a single bun binary that will contain my vite static spa which is index.html and bun runtime
@snoglobe will start working on this soon
What is the problem this feature would solve?
Congrats on the 1.0.0 release!
I was testing a migration of a simple app, that has entrypoint defined in index.html and links to index.ts. Bun build by defaults targets web, but isn't able to handle this use-case. Contrary to eq. Vite, which even expects index.html.
Bun will treat html as an asset (as expected according to the docs) and generates index.js referencing it. But it won't do anything else further with the html itself.
Are there any plans in the future to act as a drop-in replacement in the bundler segment or is that a stretch and not on the roadmap?
What is the feature you are proposing to solve the problem?
Support index.html as an entrypoint and not just .ts or .js
What alternatives have you considered?
No response