Skip to content

dbashford/mimosa-esperanto-es6-modules

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

mimosa-esperanto-es6-modules

Overview

This module will allow you to utilize ES6 module syntax when building your client code. It will transpile your JavaScript with ES6 syntax to AMD or CommonJS compliant JavaScript and include source maps.

This module wraps Rich Harris' esperanto library which performs the transpiling.

For more information regarding Mimosa, see http://mimosa.io

Usage

Add 'esperanto-es6-modules' to your list of modules. That's all! Mimosa will install the module for you when you start up.

Functionality

This module will take your ES6 module syntax code and compile it down to a syntax usable with common module specs: AMD and CommonJS.

Compiled output will include inline source maps unless running mimosa build.

Default Config

esperanto: {
  type:"amd",
  exclude: [/[/\\]vendor[/\\]/, /[/\\]main[\.-]/, /-main.js$/, /[/\\]common.js$/],
  options: {
    strict: false
  }
}
  • type: "amd", "commonjs", how you want your code to be transpiled.
  • exclude: List of regexes or strings to match files that should be excluded from transpiling. String paths can be absolute or relative to the watch.sourceDir. Regexes are applied to the entire path.
  • options: These options are passed directly to esperanto. The defaults above are applied. Check out esperanto's docs to read up on the options.

Using CoffeeScript?

For syntax like import to survive being transpiled by CoffeeScript you must use the compilers built-in ability to pass some code through the transpiler. CoffeeScript, for instance, uses the backtick to essentially have the CoffeeScript compiler ignore the code contained within.

About

A es6 module transpiler module for Mimosa

Resources

Stars

Watchers

Forks

Packages

No packages published