0.4.0 • Published 3 months ago

vite-plugin-mjml v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

 

Usage

Install vite-plugin-mjml and add it to your Vite configuration:

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

OptionTypeDescriptionDefault
inputstringPath to the directory in which .mjml files are storedresources/mail
outputstringPath to the directory in which compiled files will be writtenresources/views/emails
extensionstringExtension that will be used by compiled .mjml files.blade.php
mjmlMJMLParsingOptionsSpecific MJML compiler options{}
watchbooleanWhether to watch and compile on the fly in development modetrue
logbooleanWhether to print output in the consoletrue
0.4.0

3 months ago

0.3.2

6 months ago

0.3.1

1 year ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago