Closed speelbarrow closed 11 months ago
Thank you for your contributions @speelbarrow, I'll include your contributions and code in the larger rewrite that I'm going to make soon. Although I'll merge the pull request, the release will come after this rewrite which fixes some of the other issues.
Hello @speelbarrow, I've finished that larger rewrite I was talking about. Here are the key updates regarding your implementation.
1) I switched to the much more verbose method of detecting extensions using path.extname, as such to filter out files you have to specify the extension name as if it would be returned from path.extname.
from
await Bun.build({
entrypoints: ['./test/starting/index.html'],
outdir: generationDirectory,
plugins: [html({filter: ['css', 'ico', 'tsx']})],
})
to
await Bun.build({
entrypoints: ['./test/starting/index.html'],
outdir: generationDirectory,
plugins: [html({filter: ['.css', '.ico', '.tsx']})],
})
2) If the file is filtered out then it will not be outputted into the build directory.
3) tsx
and jsx
files now all compile as expected
Please let me know within 24 hours whether you have any changes you'd like to add to this implementation. Since I plan to make a new release then.
Hello @speelbarrow, I've finished that larger rewrite I was talking about. Here are the key updates regarding your implementation.
- I switched to the much more verbose method of detecting extensions using path.extname, as such to filter out files you have to specify the extension name as if it would be returned from path.extname.
from
await Bun.build({ entrypoints: ['./test/starting/index.html'], outdir: generationDirectory, plugins: [html({filter: ['css', 'ico', 'tsx']})], })
to
await Bun.build({ entrypoints: ['./test/starting/index.html'], outdir: generationDirectory, plugins: [html({filter: ['.css', '.ico', '.tsx']})], })
- If the file is filtered out then it will not be outputted into the build directory.
tsx
andjsx
files now all compile as expectedPlease let me know within 24 hours whether you have any changes you'd like to add to this implementation. Since I plan to make a new release then.
Sounds good to me! Thanks for everything :)
Changes made:
filter
configuration option that takes an array of strings. Files whose extensions match any of the strings in the array will be ignored by the plugin.plugins
configuration option that exposes the 'plugins' configuration option of the internal call toBun.build
.