
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@teskon/vite-plugin-ejs-engine
Advanced tools
Thiis is a fork of vite-plugin-ejs-engine
Supports:
Yarn
yarn add @teskon/vite-plugin-ejs-engine -D
or npm
npm i @teskon/vite-plugin-ejs-engine --save-dev
Use plugin in your Vite config (vite.config.ts)
import ejs from '@teskon/vite-plugin-ejs-engine'
export default {
plugins: [
ejs(),
]
}
If you're not using typescript you can enable the plugin by calling the method ejs.default in the vite.config.js file, as such:
import ejs from '@teskon/vite-plugin-ejs-engine'
export default {
plugins: [
ejs.default(),
],
};
This fork enables injection of variables by passing the variables into the ejs method, for example:
import ejs from '@teskon/vite-plugin-ejs-engine'
export default {
plugins: [
ejs.default({
inject: {
title: 'Hello world',
},
}),
],
};
You will then be able to use that variable in your template files as such:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= title %></title>
</head>
<body>
<h1>Hello world</h1>
</body>
</html>
Below you can see all available options that you can apply to this plugin.
| property | default | description |
|---|---|---|
inject | - | Data injected into HTML. |
ejsOptions | - | ejs options, @See |
Input (src/index.html):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<h1>Hello world</h1>
<!-- variable declaration -->
<% var users = [{name: 'Jose'}, {name: 'Pedro'}]; %>
<!-- variable and partial usage -->
<ul>
<% users.forEach(function(user){ %>
<%- include('user/show', {user: user}); %>
<% }); %>
</ul>
</body>
</html>
Template (src/user/show.ejs):
<li><%= user.name %></li>
Output (dist/index.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<h1>Hello world</h1>
<ul>
<li>Jose</li>
<li>Pedro</li>
</ul>
</body>
</html>
FAQs
Vite plugin for supporting ejs templates
We found that @teskon/vite-plugin-ejs-engine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.