1.1.16 • Published 6 years ago

postmask-babel v1.1.16

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

PostMask Babel Compiler

Build Status NPM version

Compiles functions in mask templates to es5

Configurate

mask.cfg('postmask-babel', BabelOptions);

Default: {"presets":["es2015"], plugins: [""external-helpers""]}

You should also include babelHelpers to the app:

npm i -g babel-cli
babel-external-helpers -t var > my-babel-helpers.js
<script type="text/javascript" src="/path/my-babel-helpers.js"></script>

Optimizer

Defines optimizers to compile functions, slots, and other scripts to es5. Can be used as standalone module, but also as a plugin for postmask.

atma-loader-postmask

$ npm i atma -g
$ atma plugin install atma-loader-postmast --save-dev

package.json

{
    ...
    "atma-loader-postmask": {
        "plugins": [
          "postmask-babel",
          "postmask-less"
        ],
        "configs":{
          "postmask-babel": BabelOptions
        }
    }
    ...
}

Runtime

Transform scripts at runtime. Use this only in some demos and in dev, not for production.

Usage
npm i babel-standalone --save-dev
npm i postmask-babel --save-dev
npm i maskjs --save
<script src="/node_modules/babel-standalone/babel.min.js"></script>
<script src="/node_modules/maskjs/lib/mask.js"></script>
<script src="/node_modules/postmask-babel/runtime.js"></script>
define Foo {
    function onRenderStart () {
        this.$.someWidget({
            onUpdate (...args) {
                console.log('foo')
            }
        });
    }
}

(c) MIT License - Atma.js Project

1.1.16

6 years ago

1.1.15

6 years ago

1.1.14

7 years ago

1.1.13

8 years ago

1.1.12

8 years ago

1.1.11

8 years ago

1.1.10

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago