Skip to content

Instantly share code, notes, and snippets.

@iRyusa
Last active February 21, 2017 12:57
Show Gist options
  • Save iRyusa/6217ad3795252db33e450f2558642285 to your computer and use it in GitHub Desktop.
Save iRyusa/6217ad3795252db33e450f2558642285 to your computer and use it in GitHub Desktop.

Using MJML beta locally

Setup

This guide allows you to quickly setup an MJML environment. You'll need Node >=6 & NPM >3

1 - Create a new folder where you'll start working

$ mkdir mjml_workspace
$ cd  mjml_workspace
$ npm init -y

2 - Now you can install either latest MJML version or beta with npm

#mjml beta
$ npm install mjml@beta 
#mjml latest
$ npm install mjml

Now you can start compile MJML file with: ./node_modules/.bin/mjml my_file.mjml

Switching from beta to release

Simply remove node_modules folder from mjml_workspace folder with rm -rf node_modules, and repeat (2)

(Optional) Add mjml shortcut instead of ./node_modules/...

Add this to your ~/.bashrc or ~/.zshrc:

export PATH="$PATH:$(npm bin)"

Note: you should remove any global installation of MJML to make this work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment