Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/damonsmith/bun-plugin-inline-templates
https://github.com/damonsmith/bun-plugin-inline-templates
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/damonsmith/bun-plugin-inline-templates
- Owner: damonsmith
- License: mit
- Created: 2024-06-14T01:18:05.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-16T22:19:03.000Z (5 months ago)
- Last Synced: 2024-08-10T11:08:51.829Z (3 months ago)
- Language: TypeScript
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bun Plugin for HTML
The `bun-plugin-inline-templates` is a plugin for the Bun build tool that replaces any `` with the contents of the path in the href.
## Installation
You can install `bun-plugin-inline-templates` using the following command:
```bash
bun add -d bun-plugin-inline-templates
```## Usage
To use this plugin, import it into your code and add it to the list of plugins when building your project with Bun. Here's an example:
```typescript
import inlineTemplates from 'bun-plugin-inline-templates';await Bun.build({
entrypoints: ['./src/index.html', './src/other.html'],
outdir: './dist', // Specify the output directory
plugins: [
inlineTemplates()
],
});
```Or if you're using it with bun-plugin-html then add it after that plugin like this:
```typescript
import html from 'bun-plugin-html';
import inlineTemplates from 'bun-plugin-inline-templates';await Bun.build({
entrypoints: ['./src/index.html', './src/other.html'],
outdir: './dist', // Specify the output directory
plugins: [
html(),
inlineTemplates()
],
});
```## Acknowledgements
This plugin was created by mostly copying the bun-plugin-html plugin from Bjorn at https://github.com/BjornTheProgrammer/bun-plugin-html
Massive thanks to that project, this plugin is designed to be inserted before it so that they can be used together.
## License
This plugin is licensed under MIT.