Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/innocenzi/vite-plugin-mjml
Vite plugin to add MJML compilation to your build pipeline
https://github.com/innocenzi/vite-plugin-mjml
laravel mjml vite vite-plugin
Last synced: 2 months ago
JSON representation
Vite plugin to add MJML compilation to your build pipeline
- Host: GitHub
- URL: https://github.com/innocenzi/vite-plugin-mjml
- Owner: innocenzi
- Created: 2022-04-13T12:50:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-29T17:39:44.000Z (11 months ago)
- Last Synced: 2024-05-01T16:31:01.297Z (8 months ago)
- Topics: laravel, mjml, vite, vite-plugin
- Language: TypeScript
- Homepage:
- Size: 229 KB
- Stars: 34
- Watchers: 1
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
MJML plugin for Vite
A plugin for compilingmjml
files in your Vite pipeline.
npm i -D vite-plugin-mjml
## Usage
Install `vite-plugin-mjml` and add it to your Vite configuration:
```ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import laravel from 'vite-plugin-laravel'
import mjml from 'vite-plugin-mjml'export default defineConfig({
plugins: [
laravel(),
vue(),
mjml({
input: 'resources/mail',
output: 'resources/views/emails',
extension: '.blade.php',
}),
],
})
```When running `vite dev`, all `.mjml` files in your `input` directory will be compiled to `output` when saved.
Similarly, when building for production, all files in `input` will be compiled as well.> For instance, `resources/mail/onboarding/welcome.mjml` would be written to `resources/views/emails/onboarding/welcome.blade.php`.
## Options
| Option | Type | Description | Default |
| ----------- | -------------------- | ------------------------------------------------------------------------------- | ------------------------ |
| `input` | `string` | Path to the directory in which `.mjml` files are stored | `resources/mail` |
| `output` | `string` | Path to the directory in which compiled files will be written | `resources/views/emails` |
| `extension` | `string` | Extension that will be used by compiled `.mjml` files | `.blade.php` |
| `mjml` | `MJMLParsingOptions` | Specific MJML [compiler options](https://documentation.mjml.io/#inside-node-js) | `{}` |
| `watch` | `boolean` | Whether to watch and compile on the fly in development mode | `true` |
| `log` | `boolean` | Whether to print output in the console | `true` |
·
Built with ❤︎ by Enzo Innocenzi