GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - callumlocke/multiform: Write NPM modules in ES6/7 with multiple builds optimised for different V8 versions

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
.eslintrc
.eslintrc
 
 
README.md
README.md
 
 
index.js
index.js
 
 
package.json
package.json
 
 

Repository files navigation

multiform

A simple system for writing modules that ship with multiple Babel builds, each optimised for a different V8 version.

Why

This is a stopgap for people who want to write ES6-7 code today, using things like generators and async functions, and build it with Babel – but without simply compiling everything down to ES5.

Ideally you want your users to run real, native generators where supported (because they're faster, they're more debuggable, and they don't require a runtime library) while still providing an ES5-only build for users on older platforms.

Multiform helps organise this kind of setup.

How

  • You define your Babel configurations in multiform.json.
  • The multiform command (installed as a devDependency, multiform-build, and run on prepublish) builds your src folder into dist-0, dist-1 etc. corresponding with your Babel configurations.
  • Your main script automatically selects and loads the best dist for the current V8 version, like this: module.exports = require('multiform').load();

See multiform-template for an example setup.

multiform.json reference

  • builds – array of objects with these properties:
    • version (optional) – the minimum version of V8 that can run this build.
    • options – the Babel options.
  • defaults (optional) – base options shared by all your builds. (Each build config will be deep-merged into this.)

Example:

{
  "builds": [
    {
      "version": "4.1.0.27",
      "options": {
        "blacklist": [
          "regenerator",
          "es6.forOf",
          "es6.templateLiterals",
          "es6.constants"
        ],
        "optional": [
          "bluebirdCoroutines"
        ]
      }
    },
    {
      "options": {
        "optional": [
          "runtime",
          "es7.asyncFunctions"
        ]
      }
    }
  ],

  "defaults": {
    "loose": true
  }
}

About

Write NPM modules in ES6/7 with multiple builds optimised for different V8 versions

Resources

Readme
Activity

Stars

6 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.