1.0.0 • Published 1 year ago

babel-plugin-auto-track v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

babel-plugin-auto-track

Usage

add babel-plugin-dev-debug plugin to babel.config.js

// babel.config.js
module.exports = {
  plugins: ["auto-track", { trackerPath: "tracker" }],
};

in you code

import aa from 'aa';
import * as bb from 'bb';
import { cc } from 'cc';
import 'dd';

function a () {
    console.log('aaa');
}

class B {
    bb() {
        return 'bbb';
    }
}

const c = () => 'ccc';

const d = function () {
    console.log('ddd');
}

Convert the above code to this:

import _tracker2 from "tracker";
import aa from 'aa';
import * as bb from 'bb';
import { cc } from 'cc';
import 'dd';

function a() {
  _tracker2();

  console.log('aaa');
}

class B {
  bb() {
    _tracker2();

    return 'bbb';
  }

}

const c = () => {
  _tracker2();

  return 'ccc';
};

const d = function () {
  _tracker2();

  console.log('ddd');
};
1.0.0

1 year ago