Rollup plugin for template.js, a lightweight JavaScript template engine. Version 3.1.4 requires @templatejs/runtime as a peer dependency. Supports both Rollup and Vite with the same configuration, allowing custom delimiters and sandbox mode. Includes TypeScript types. Active maintenance.
npm install rollup-plugin-templatejsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Rollup config using the plugin with custom delimiters, importing a .tmpl file and rendering it.
Wrap plugin in an object with enforce: 'pre' in the plugin array, e.g., { ...template(options), enforce: 'pre' }.Run npm install --save @templatejs/runtime alongside the plugin.
Ensure the same sTag and eTag values are used in both template() options and any runtime configuration.
Upgrade to version 3.x and update configuration as per documentation.
If using .html or other extensions, update the include pattern accordingly.
npm install --save @templatejs/runtime
Use import template from 'rollup-plugin-templatejs' (ESM default).
Add enforce: 'pre' to the plugin object.
Use ESM import or enable esModuleInterop in tsconfig.json.
Update include to match your file extension (e.g., include: ['**/*.html']).