vue3-cli-plugin-midway-hooks

0.1.2 • Public • Published

Vue CLI Plugin With Midway Hooks Development

This plugin is meant to provide all @midwayjs/faas-dev-pack options to vue-cli.

NPM Version NPM Downloads License

Installation

yarn add vue3-cli-plugin-midway-hooks
# OR npm install vue3-cli-plugin-midway-hooks

Usage

// vue.config.js
module.exports = {
  pluginOptions: {
    isHooks: true, // use hooks
    faas: {
      // ...
    }
  }
}

Options

See midway faas dev pack for options object to pass to the plugin.

Object examples

  • default value, you can overwrite it.
// vue.config.js
module.exports = {
  pluginOptions: {
    faas: {
      sourceDir: 'src/apis',
      // ignore function name
      ignoreWildcardFunctions: ['render'],
      // ignore pattern
      ignorePattern: (req) => {
        const { pathname } = URL.parse(req.url);
        return /\.(js|css|map|json|png|jpg|jpeg|gif|svg|eot|woff2|ttf)$/.test(pathname);
      }
    },
    isHooks: true,
    hooksRule: ['ts', 'js']
  }
}

License

Vue CLI Plugin Midway Hooks is licensed under MIT License.

Package Sidebar

Install

npm i vue3-cli-plugin-midway-hooks

Weekly Downloads

3

Version

0.1.2

License

MIT

Unpacked Size

5.65 kB

Total Files

4

Last publish

Collaborators

  • cocoyin