Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Vue技术栈单页面构建工具
Gaea构建工具是基于Node.js、Webpack模版工程等的Vue技术栈的整套解决方案,包含了开发、调试、打包上线完整的工作流程
请先安装node,版本大于8.9.0,如果没有安装,请前往安装
npm i gaea-cli -g
全局安装g2 init projectName(gaea init projectName)
初始化项目,项目名字和目录名字一致会默认在当前文件下生成模版npm i
安装依赖npm run dll
编译第三方库npm run dev
开发npm run build
打包编译npm run upload
上传npm run lint
代码检查、格式化npm run carefree
真机调试npm run skeleton
骨架屏注入npm run compress
图片压缩转换安装后,使用之前还需要配置上线路径、项目信息等
webpack.config.js
配置上传配置上传测试服务器地址和路径,具体可参看,配置上传的host、用户名username、密码password、上传地址target example
new WebpackUploadPlugin({
source:'build',
ignoreRegexp:/node_moudles/,
httpOption:{
host:'测试服务器地址',
port:3000,
username:'',
password:'',
target:`/var/www/html/${config.ftpServer}/${config.ftpTarget}`
}
})
webpack.config.js
配置真机调试配置carefree真机调试,具体可参看,例如:我们将开发阶段的代码打包上传至测试域名page.jd.com,用于真机扫二维码调试 example
new Carefree({
justUseWifi: false,
publicPath: '//page.jd.com/'+config.ftpTarget+'/'+config.version+'/',
ftp: {
host: '测试服务器地址',
port: 3000,
source: 'build',
target: '/var/www/html/page.jd.com/'+config.ftpTarget+'/'
}
})
webpack.dll.config.js
配置第三库依赖目前的第三方库有 vue、qs、axios、vue-router等,如果增加和删除的话,可以更改字符串:"vue,qs,axios,vue-router" ;重新执行npm run dll
package.json
配置项目信息https://static.360buyimg.com/exploit/mtelink/1.0.0/js/app.js
//static.360buyimg.com/exploit/mtelink
如果是html和静态资源都交给后端,那么这个值设置成空就行。npm run compress
压缩图片。https://static.360buyimg.com/exploit/mtelink/lib/vendor.dll.js
| https://static.360buyimg.com/exploit/mtelink/lib/1.0.0/vendor.dll.js
采用TinyPNG node.js API 进行在线压缩图片,并且转换Webp格式文件,需要去官网注册KEY,填入package.json
文件
tinypngkey
字段。每个账号每个月有500次的免费上传压缩限制。
文件router.js 配置了脚手架的相关路由信息,推荐使用【history】路由。脚手架支持history路由和hash路由。在 router.js 中默认是history路由。它是真实的路由地址,所以需要后台那帮你配置重定向。
比如首页的路由是 http://telink.jd.com/index。那么你的路由的首页也是/index 。 比如搜索页/search 是不存在后端服务器上的。所以需要你让后端把其余的单页面的路由都重定指向首页的vm。
对于carefree,上传到测试服务器page.jd.com 默认是hash路由,方便大家进行测试
const router = new VueRouter({
mode:carefree?'hash':'history',
routes
});
脚手架提供了vue的骨架屏注入方案,在命令行工具选择骨架屏,就会下载骨架屏相对应的模板。
src/skeleton 就是基于vue-server-renderer服务端渲染,抽取手写骨架屏的css 和 html 注入到 打包的html中。
src/skeleton/skeleton.vue 文件就是手写的骨架屏组件,推荐只渲染入口页首屏骨架 npm run skeleton 就会将src/skeleton/index.html 生成到外层src/index.html 注入完成后,就可以后续正常开发
smock 是开发阶段基于swagger的自动化mock假数据工具,需要配置参数如下: 修改package.json 中字段,具体可以参看
"smock": {
"host": "",
"domain": "",
"projectName": ""
}
MIT License - LICENSE
FAQs
gaea-cli
The npm package gaea-cli receives a total of 16 weekly downloads. As such, gaea-cli popularity was classified as not popular.
We found that gaea-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.