Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including fis-parser-babel-latest with all npm packages installed. Try it out:

var fisParserBabelLatest = require("fis-parser-babel-latest")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

fis-parser-babel-latest v2.0.2

A Plugin to translate es2015/es2016/es2017 to es5 based on babel in fis.

fis-parser-babel-latest

A Plugin to translate es2015/es2016/es2017 to es5 based on babel in fis/fis3.

NPM version node version npm download

INSTALL

npm install -g fis-parser-babel-latest

USE

  • in fis3

    fis3.match('js/**.js', {
        parser: fis.plugin('babel-latest')
    })
    
    fis3.match('js/**.js', {
        parser: fis.plugin('babel-latest', {
            "presets": [
                ["env", {
                    "loose": true
                }],
                "react",
                "stage-0"
            ]
        })
    })
    
  • in fis

    fis.config.set('modules.parser.js', 'babel-latest');
    fis.config.set('settings.parser.babel-latest', {
        // options
    });
    
    fis.config.set('roadmap.path', [
        {
            reg: '/es6/**.js',
            isES6: true
        },
        {
            reg: '**.js',
            isES6: false // 排除其他
        }
    ].concat(fis.config.get('roadmap.path', []));
    

更多配置项参考:http://babeljs.io/docs/usage/options/

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free