Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Plugin, ResolvedConfig, UserConfig} from "vite";
import {Plugin, ResolvedConfig} from "vite";
import ejs from "ejs";

// ShortHand for EjsOptions or Undefined
Expand Down Expand Up @@ -30,8 +30,8 @@ function ViteEjsPlugin(data: ViteEjsPluginDataType = {}, options?: ViteEjsPlugin
},

transformIndexHtml: {
enforce: "pre",
transform(html) {
order: "pre",
handler(html) {
if (typeof data === "function") data = data(config);
let ejsOptions = options && options.ejs ? options.ejs : {};
if (typeof ejsOptions === "function") ejsOptions = ejsOptions(config);
Expand Down Expand Up @@ -59,4 +59,4 @@ function ViteEjsPlugin(data: ViteEjsPluginDataType = {}, options?: ViteEjsPlugin
}


export {ViteEjsPlugin, ejs}
export {ViteEjsPlugin, ejs}
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-plugin-ejs",
"version": "1.6.4",
"version": "1.7.0",
"description": "Use Ejs in your entrypoint i.e index.html",
"main": "index.js",
"types": "index.d.ts",
Expand All @@ -14,12 +14,15 @@
"prepublishOnly": "npm run build"
},
"devDependencies": {
"@types/ejs": "^3.1.1",
"typescript": "^4.9.3",
"vite": "^3.2.4"
"@types/ejs": "^3.1.5",
"typescript": "^5.2.2",
"vite": "^5.0.0"
},
"dependencies": {
"ejs": "^3.1.8"
"ejs": "^3.1.9"
},
"peerDependencies": {
"vite": ">=5.0.0"
},
"keywords": [
"vite",
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Use [ejs](https://www.npmjs.com/package/ejs) template language in your entrypoint i.e `index.html`

**Note:** For Vite version < `5` use [`v1.6.4`](https://www.npmjs.com/package/vite-plugin-ejs/v/1.6.4) of this plugin.

## Menu

- [Installation](#installation)
Expand Down
Loading