{"id":13775073,"url":"https://github.com/fm-ph/rollup-plugin-twig","last_synced_at":"2025-05-11T07:31:54.652Z","repository":{"id":95258898,"uuid":"83617377","full_name":"fm-ph/rollup-plugin-twig","owner":"fm-ph","description":"📃 Rollup plugin that imports pre-compiled Twig.js templates","archived":false,"fork":false,"pushed_at":"2017-04-19T09:03:17.000Z","size":8,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-10-14T01:31:48.701Z","etag":null,"topics":["plugin","rollup","rollup-plugin","templating","twig"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fm-ph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-03-02T00:55:06.000Z","updated_at":"2019-12-09T03:44:57.000Z","dependencies_parsed_at":"2023-04-05T00:30:52.604Z","dependency_job_id":null,"html_url":"https://github.com/fm-ph/rollup-plugin-twig","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"f38c7c67308fc0eafc5dcc5d2f8d106b257e9926"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fm-ph%2Frollup-plugin-twig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fm-ph%2Frollup-plugin-twig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fm-ph%2Frollup-plugin-twig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fm-ph%2Frollup-plugin-twig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fm-ph","download_url":"https://codeload.github.com/fm-ph/rollup-plugin-twig/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225027329,"owners_count":17409412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["plugin","rollup","rollup-plugin","templating","twig"],"created_at":"2024-08-03T17:01:33.569Z","updated_at":"2024-11-17T10:30:29.014Z","avatar_url":"https://github.com/fm-ph.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Templating"],"readme":"# rollup-plugin-twig\n\n[![build status][travis-image]][travis-url]\n[![stability][stability-image]][stability-url]\n[![npm version][npm-image]][npm-url]\n[![js-standard-style][standard-image]][standard-url]\n[![semantic-release][semantic-release-image]][semantic-release-url]\n\n[Rollup](https://github.com/rollup/rollup) plugin that imports pre-compiled [Twig.js](https://github.com/twigjs/twig.js) templates.\n\n## Installation\n\n[![NPM](https://nodei.co/npm/rollup-plugin-twig.png)](https://www.npmjs.com/package/rollup-plugin-twig)\n\n```sh\nnpm install rollup-plugin-twig --save-dev\n```\n\n## Usage\n\nConfigure Rollup with `rollup-plugin-twig` :\n\n```js\nimport { rollup } from 'rollup'\nimport twig from 'rollup-plugin-twig'\n\nrollup({\n  entry: 'src/main.js',\n  plugins: [\n    twig()\n  ]\n}).then(...)\n```\n\nCreate a template :\n\n```html\n\u003cdiv\u003e{{ foo }}\u003c/div\u003e\n```\n\nImport the template and render it with data (optional) :\n\n```js\nimport template from './template.twig'\n\nconst data = { foo: 'bar' }\nconsole.log(template.render(data)) // \u003cdiv\u003ebar\u003c/div\u003e\n```\n\n## Options\n\nPlugin options you can pass :\n\n* `include` - Minimatch or array of minimatch with files that should be included by default.\n* `exclude` - Minimatch or array of minimatch with files that should be excluded by default.\n* `minify` - Minify the template (`true` by default).\n\n## Build\n\nTo build the sources with `rollup` in `./lib` directory :\n\n```sh\nnpm run build\n```\n\n## Testing\n\nTo run the tests, first clone the repository and install its dependencies :\n\n```sh\ngit clone https://github.com/fm_ph/rollup-plugin-twig.git\ncd rollup-plugin-twig\nnpm install\n```\n\nThen, run the tests :\n\n```sh\nnpm test\n```\n\nTo watch (test-driven development) :\n\n```sh\nnpm run test:watch\n```\n\nFor coverage :\n\n```sh\nnpm run test:coverage\n```\n\n## License\n\nMIT [License](LICENSE.md) © [Patrick Heng](http://hengpatrick.fr/) [Fabien Motte](http://fabienmotte.com/) \n\n[travis-image]: https://img.shields.io/travis/fm-ph/rollup-plugin-twig/master.svg?style=flat-square\n[travis-url]: http://travis-ci.org/fm-ph/rollup-plugin-twig\n[stability-image]: https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square\n[stability-url]: https://nodejs.org/api/documentation.html#documentation_stability_index\n[npm-image]: https://img.shields.io/npm/v/rollup-plugin-twig.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/rollup-plugin-twig\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[standard-url]: https://github.com/feross/standard\n[semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square\n[semantic-release-url]: https://github.com/semantic-release/semantic-release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffm-ph%2Frollup-plugin-twig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffm-ph%2Frollup-plugin-twig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffm-ph%2Frollup-plugin-twig/lists"}