zf-plugin-version
v1.0.2
Published
提示用户,@qif/qt-video包需要更新到最新版本
Downloads
2
Readme
zf-plugin-version
TODO: description
Usage
webpack插件,提示用户需要更新
const { VersionPlugin } = require('zf-plugin-version')
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
plugins: [
new VersionPlugin()
]
}
})
命令交互式提示用户需要更新(vue-cli@4)
// 新建serve.preHandle.js
const { VersionPrompt } = require('zf-plugin-version')
const child_process = require('child_process')
module.exports = async (api, options) => {
api.registerCommand(
'preHandle',
{
description: '检查视频版本',
usage: 'vue-cli-service preHandle'
},
async () => {
await VersionPrompt()
}
)
}
修改package.json
{
"scripts": {
"dev": "vue-cli-service serve",
"builds": "vue-cli-service --mode production build",
"build": "vue-cli-service preHandle --mode production && npm run builds"
},
"vuePlugins": {
"service": [
"./serve.preHandle.js"
]
}
}
命令交互式提示用户需要更新(vue-cli@5以上)
const { VersionPrompt } = require('zf-plugin-version')
module.exports = async () => {
return await VersionPrompt(defineConfig({
transpileDependencies: true,
configureWebpack: {
plugins: []
}
}))
}