preval.macro
Pre-evaluate code at build-time with babel-macros
Last updated 5 months ago by kentcdodds .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install preval.macro 
SYNC missed versions from official npm registry.

preval.macro

This is a babel-plugin-macros macro for babel-plugin-preval.

Please see those projects for more information.

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's devDependencies:

npm install --save-dev preval.macro

You'll also need to install and configure babel-plugin-macros if you haven't already.

Usage

Once you've configured babel-plugin-macros you can import/require preval.macro. For example:

import preval from 'preval.macro'

const one = preval`module.exports = 1 + 2 - 1 - 1`

Note:

babel-plugin-preval allows you to have a few more APIs than you have with this macro, but this macro comes with all the benefits of using babel-plugin-macros (which you can read about in the babel-plugin-macros docs).

Current Tags

  • 5.0.0                                ...           latest (5 months ago)

7 Versions

  • 5.0.0                                ...           5 months ago
  • 4.0.0                                ...           9 months ago
  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago

Copyright 2014 - 2016 © taobao.org |