使用jenkins 执行自动构建vue项目,项目安装依赖都已经完成了,build 步骤出现错误
这个错误可以使用 vue.config.js解决,但是治标不治本,还有大佬知道比较好的方法吗
module.exports = {
css: {
extract: true,
},
}
错误代码
found 8 vulnerabilities (5 moderate, 3 high)
run `npm audit fix` to fix them, or `npm audit` for details
> vue-jenkins@0.1.0 build C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\react hellow
> vue-cli-service build
- Building for production...
C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\react hellow\node_modules\neo-async\async.js:16
throw new Error('Callback was already called.');
^
Error: Callback was already called.
这里不要拷贝依赖包,直接将依赖下载进jenkins的工作空间就好
打包配置文件建议参考下这个vue-element-admin
jenkins打包前端就是注意下node的版本,其余还是要看你的项目的打包脚本
我的配置


这里打包并压缩。下一步就要发包到服务器了