{"id":13774642,"url":"https://github.com/daankauwenberg/rollup-plugin-mjml","last_synced_at":"2025-05-11T06:33:26.911Z","repository":{"id":37875253,"uuid":"233861428","full_name":"daankauwenberg/rollup-plugin-mjml","owner":"daankauwenberg","description":"Compile MJML templates with Rollup","archived":false,"fork":false,"pushed_at":"2023-01-05T05:16:50.000Z","size":1127,"stargazers_count":7,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T11:58:46.835Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daankauwenberg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-14T14:36:19.000Z","updated_at":"2025-03-25T22:41:54.000Z","dependencies_parsed_at":"2023-02-03T12:31:58.092Z","dependency_job_id":null,"html_url":"https://github.com/daankauwenberg/rollup-plugin-mjml","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daankauwenberg%2Frollup-plugin-mjml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daankauwenberg%2Frollup-plugin-mjml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daankauwenberg%2Frollup-plugin-mjml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daankauwenberg%2Frollup-plugin-mjml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daankauwenberg","download_url":"https://codeload.github.com/daankauwenberg/rollup-plugin-mjml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253528415,"owners_count":21922623,"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":[],"created_at":"2024-08-03T17:01:28.929Z","updated_at":"2025-05-11T06:33:26.603Z","avatar_url":"https://github.com/daankauwenberg.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Other File Imports"],"readme":"\u003cdiv class=\"text-xs-center\" align=\"center\" style=\"margin: 20px\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/9211670/72424331-170b8e00-3786-11ea-9792-9168ee5aafec.png\"\u003e\n\u003c/div\u003e\n\n## Install\n\n```bash\nnpm install rollup-plugin-mjml --save-dev\n```\n## Usage\n\nAdd `mjml()` to your `rollup.config.js` file.\n\n```js\n// rollup.config.js\nimport mjml from 'rollup-plugin-mjml';\n\nexport default {\n  //...\n  plugins: [\n    mjml()\n  ]\n}\n```\n\nAfter configuring you need to include the .mjml template files in your bundle. You can use either option:\n\n#### Importing in JS\n\nEasiest withouth extra dependencies is to import the templates in your Javascript:\n\n```js\n// main.js\nimport './mailtemplate.mjml'\n```\n\n#### Using @rollup/plugin-multi-entry\n\nAlternatively, you can use Rollup's own plugin [multi-entry](https://github.com/rollup/plugins/tree/master/packages/multi-entry) to have multiple entry files and include them with something like `input: ['src/main.js', 'src/mail/**/*.mjml']`.\n\n```js\n// rollup.config.js\nimport multi from '@rollup/plugin-multi-entry';\nimport mjml from 'rollup-plugin-mjml';\n\nexport default {\n  input: ['src/main.js', 'src/mail/**/*.mjml'],\n  //...\n  plugins: [multi(), mjml()],\n}\n```\n\n## Options\n\nOptions can be added as parameter to the plugin, for example:\n\n```js\n// rollup.config.js\nexport default {\n  //...\n  plugins: [\n    mjml({\n      outputDir: 'dist/mail',\n      validationLevel: 'strict',\n    })\n  ]\n}\n```\n\n### `outputDir`\nType: `String`\u003cbr\u003e\nDefault: _Same location as where the bundle is exported_\n\nA relative path from where Rollup is initiated, e.g. `dist/email`.\n\n### `outputExt`\nType: `String`\u003cbr\u003e\nDefault: `html`\n\nThe extension can be changed to fit needs e.g. twig. This only changes the filename, no other rendering is done. Language specific logic could be placed in `mj-raw` tags.\n\n### `exclude`\n\nType: `String` | `Array[...String]`\u003cbr\u003e\nDefault: `null`\n\nA [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored.\n\n### `include`\n\nType: `String` | `Array[...String]`\u003cbr\u003e\nDefault: `null`\n\nA [minimatch pattern](https://github.com/isaacs/minimatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.\n\n### MJML Options\n\nAdditionally the MJML options can be added to the top level of the options object. More information can be found in the [MJML Documentation](https://mjml.io/documentation/#inside-node-js). In short, following options can be added:\n\n- `fonts`\n- `keepComments`\n- `beautify`\n- `minify`\n- `validationLevel`\n- `filePath`\n- `mjmlConfigPath`\n- `minifyOptions`\n- `juicePreserveTags`\n\n## License\n\nThe ISC License (ISC). Please see [License File](https://github.com/daankauwenberg/rollup-plugin-mjml/blob/master/LICENSE) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaankauwenberg%2Frollup-plugin-mjml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaankauwenberg%2Frollup-plugin-mjml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaankauwenberg%2Frollup-plugin-mjml/lists"}