
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
@jawish/rollup-plugin-twig
Advanced tools
Rollup plugin to import Twig templates as a compiled function.
Rollup plugin that pre-compiles Twig.js templates.
NPM:
npm install --save-dev rollup-plugin-twig
Yarn:
yarn add --dev rollup-plugin-twig
Update rollup.config.js
:
import { rollup } from 'rollup';
import strip from 'rollup-plugin-twig';
export default {
input: 'src/index.js',
output: [
{
format: 'cjs',
file: 'dist/my-lib.cjs.js'
}
],
plugins: [
twig()
]
};
Create your Twig template files *.twig
. e.g.:
<div>{{ name }}</div>
Import your Twig templates where needed. e.g:
import template from './template.twig'
const data = { name: 'John Doe' }
console.log(template.render(data)) // <div>John Doe</div>
Plugin options you can pass :
include
Minimatch or array of minimatch with files that should be included by default.
exclude
Minimatch or array of minimatch with files that should be excluded by default.
minify
Minify the template using html-minifier
. Default: true
.
minifyOptions
Options to configure html-minifier
.
Default options:
{
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
decodeEntities: true,
html5: true,
keepClosingSlash: true,
minifyCSS: true,
minifyJS: true,
minifyURLs: true,
}
MIT License
FAQs
Rollup plugin to import Twig templates as a compiled function.
The npm package @jawish/rollup-plugin-twig receives a total of 0 weekly downloads. As such, @jawish/rollup-plugin-twig popularity was classified as not popular.
We found that @jawish/rollup-plugin-twig 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
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.