vite-plugin-html-inject
Advanced tools
Comparing version 1.0.4 to 1.1.0
import { Plugin } from 'vite'; | ||
declare type InjectHTMLConfig = { | ||
tagName?: string; | ||
sourceAttr?: string; | ||
replace?: { | ||
@@ -11,4 +13,4 @@ undefined?: string; | ||
}; | ||
declare function injectHTML(cfg?: InjectHTMLConfig): Plugin; | ||
declare function injectHTML(pluginConfig?: InjectHTMLConfig): Plugin; | ||
export { injectHTML as default }; |
{ | ||
"name": "vite-plugin-html-inject", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "Split your index.html into multiple files and inject them where ever you want!", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -31,10 +31,10 @@ # vite-plugin-html-inject | ||
<!-- Loads the specified .html file --> | ||
<load ="src/html/header/branding.html" /> | ||
<load src="src/html/header/branding.html" /> | ||
<!-- Loads index.html or index.htm file inside the specified directory --> | ||
<load ="src/html/header" /> | ||
<load src="src/html/header" /> | ||
<div> | ||
<load ="src/html/body/sidebar.html" /> | ||
<load ="src/html/body" /> | ||
<load src="src/html/body/sidebar.html" /> | ||
<load src="src/html/body" /> | ||
</div> | ||
<load ="src/html/footer" /> | ||
<load src="src/html/footer" /> | ||
</body> | ||
@@ -56,3 +56,3 @@ </html> | ||
<load | ||
="src/some-static-link.htm" | ||
src="src/some-static-link.htm" | ||
label="Go to DuckDuckGo" | ||
@@ -62,3 +62,3 @@ href="https://duckduckgo.com/" | ||
<load | ||
="src/some-static-link.htm" | ||
src="src/some-static-link.htm" | ||
label="Go to Google" | ||
@@ -93,2 +93,25 @@ href="https://google.com" | ||
## Customization | ||
You are able to customize the loader tag name and the source attribute name.\ | ||
For example a configuration like: | ||
```js | ||
injectHTML({ | ||
tagName: 'loader', // Default is `load` | ||
sourceAttr: 'file', // Default is `src` | ||
}); | ||
``` | ||
will replace: | ||
```html | ||
<!-- Load a HTML part --> | ||
<loader | ||
file="src/some-static-link.htm" | ||
label="Go to DuckDuckGo" | ||
href="https://duckduckgo.com/" | ||
/> | ||
``` | ||
## Debugging | ||
@@ -105,1 +128,10 @@ | ||
``` | ||
## Support | ||
Love open source? Enjoying my project?\ | ||
Your support can keep the momentum going! Consider a donation to fuel the creation of more innovative open source software. | ||
| via Ko-Fi | Buy me a coffee | via PayPal | | ||
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Y8Y2ALMG) | <a href="https://www.buymeacoffee.com/donnikitos" target="_blank"><img src="https://nititech.de/donate-buymeacoffee.png" alt="Buy Me A Coffee" width="174"></a> | <a href="https://www.paypal.com/donate/?hosted_button_id=EPXZPRTR7JHDW" target="_blank"><img src="https://nititech.de/donate-paypal.png" alt="PayPal" width="174"></a> | |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13824
215
133