babel-plugin-transform-inline-functions
This is a simple babel plugin to inline some specially marked functions.
Last updated 3 years ago by emilecantin .
ISC · Original npm · Tarball · package.json
$ cnpm install babel-plugin-transform-inline-functions 
SYNC missed versions from official npm registry.

babel-plugin-transform-inline-functions

This is a simple babel plugin to inline some specially marked functions.

Examples

In:

function __INLINE__test(test) {
  return test;
}
__INLINE__test("Test 1");
__INLINE__test("Test 2");

Out:

"Test 1";
"Test 2";

Usage

Install the plugin:

npm install --save babel-plugin-transform-inline-functions

Add this to your .babelrc:

  "plugins": ["transform-inline-functions"]

And start inlining functions in your code! The plugin will inline all functions starting with __INLINE__ in their respective scope.

IMPORTANT: The plugin will only output the return statement for your original function; having a full function body will probably not do what you'd expect. Keep things simple.

Current Tags

  • 1.0.4                                ...           latest (3 years ago)

5 Versions

  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 6
Dependencies (2)
Dev Dependencies (10)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |