1.0.11 • Published 4 years ago

babel4catch v1.0.11

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

babel4catch

一个自动给 function 函数加入 try/catchbabel plugin

Install

yarn add babel4catch

Example

before:

var fn = function(){
  console.log('hello world');
}

after:

var fn = function () {
  try {
    console.log(2);
  } catch (error) {
    console.log(error);
  }
};

How to config

webpack

rules: [{
  test: /\.js$/,
  exclude: /node_modules/,
  use: [
+    "babel4catch",
    "babel-loader",
  ]
}]
1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago