webapck-plugin-add-try-catch

2.0.0 • Public • Published

Introduction

  • 文件改动或删除时,自动收集文件中的函数类语句,如果有改动且blockstatement无try...catch包裹,那么执行插件
  • 编译前,执行插件

Install

npm i webapck-plugin-add-try-catch -D

Usage

// webpack.config.js
const addTryCatch = require('webapck-plugin-add-try-catch')

module.exports = {
  ...
  plugins: [
    ...
    new addTryCatch({
      dir: ['./src', './constant'], 
      ignored: /someFileName|someDirName/
    })
  ]
}

Options

  • dir (string/array): 需要监听的目录名, 相对路径
  • ignored (regexp): 过滤掉的文件名、目录名

Package Sidebar

Install

npm i webapck-plugin-add-try-catch

Weekly Downloads

3

Version

2.0.0

License

MIT

Unpacked Size

12 kB

Total Files

4

Last publish

Collaborators

  • yfm