malta-babel

    1.1.1 • Public • Published

    npm version npm downloads npm downloads

    This plugin can be used on: .ts and .js files

    Options :
    - config : the path relative to the execution folder of a config file

    All official presets are already shipped in malta-babel, if in the config file you set up the usage of one or more plugins you need to add the dependency manually to Your project.

    Sample usage:

    malta app/source/index.js public/js -plugins=malta-babel[config:\"myconf.json\"]
    

    or in the .json file :

    "app/source/index.js" : "public/js -plugins=malta-babel[config:\"myconf.json\"]"
    

    or in a script :

    var Malta = require('malta');
    Malta.get().check([
        'app/source/index.js',
        'public/js',
        '-plugins=malta-babel[config:\"myconf.json\"]',
        '-options=showPath:false,watchInterval:500,verbose:0'
        ]).start(function (o) {
            var s = this;
            console.log('name : ' + o.name)
            console.log("content : \n" + o.content);
            'plugin' in o && console.log("plugin : " + o.plugin);
            console.log('=========');
        });

    where my config could be:

    {
        "presets": [
            [
                "@babel/env",
                {
                    "targets": {
                        "edge": "17",
                        "firefox": "60",
                        "chrome": "67",
                        "safari": "11.1"
                    },
                    "useBuiltIns": "usage"
                }
            ]
        ]
    }

    Install

    npm i malta-babel

    DownloadsWeekly Downloads

    11

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    5.35 kB

    Total Files

    4

    Last publish

    Collaborators

    • fedeghe