EJS support for Parcel bundler
npm install -D parcel-plugin-ejs-template
Use your .ejs
files as entry files to start bundling using parcel-bundler
.
You can pass some local variables to your .ejs
file by creating a config file named ejs.config.js
in your directory. File schema should be like following example:
module.exports = {
locals: {
foo: "bar",
},
};
These variables will be available in your .ejs
file.
<div>
<%= locals.foo %>
</div>
For more information, please refer to https://parceljs.org/ and https://ejs.co/