https://github.com/midwayjs/vue-cli-plugin-midway-hooks
Provide midway hooks dev pack options to vue-cli
https://github.com/midwayjs/vue-cli-plugin-midway-hooks
Last synced: 11 months ago
JSON representation
Provide midway hooks dev pack options to vue-cli
- Host: GitHub
- URL: https://github.com/midwayjs/vue-cli-plugin-midway-hooks
- Owner: midwayjs
- License: mit
- Created: 2020-11-25T02:53:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-12-28T16:04:19.000Z (over 4 years ago)
- Last Synced: 2025-05-10T14:18:43.274Z (about 1 year ago)
- Language: TypeScript
- Size: 8.79 KB
- Stars: 1
- Watchers: 14
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Vue CLI Plugin With Midway Hooks Development
This plugin is meant to provide all @midwayjs/faas-dev-pack options to vue-cli.
## Installation
``` bash
yarn add vue3-cli-plugin-midway-hooks
# OR npm install vue3-cli-plugin-midway-hooks
```
## Usage
```js
// vue.config.js
module.exports = {
pluginOptions: {
isHooks: true, // use hooks
faas: {
// ...
}
}
}
```
## Options
See [midway faas dev pack](https://github.com/midwayjs/midway-faas/tree/master/packages/faas-dev-pack) for `options` object to pass to the plugin.
### Object examples
* default value, you can overwrite it.
```js
// 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](./LICENSE).