javascript - 如何在别人电脑上打开,gulp+bower配置的项目?

查看:125
本文介绍了javascript - 如何在别人电脑上打开,gulp+bower配置的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

//bower.json如下:
{
"name": "webapp",
"description": "angularjs webapp",
"main": "",
"keywords": [

"angularjs"

],
"license": "MIT",
"homepage": "",
"private": true,
"ignore": [

"**/.*",
"node_modules",
"bower_components",
"test",
"tests"

],
"dependencies": {

"angular": "^1.6.4",
"angular-ui-router": "ui-router#^0.4.2",
"angular-cookies": "^1.6.4",
"angular-validation": "^1.4.3"

}
}

//packa.json如下:
{
"name": "webapp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {

"test": "echo \"Error: no test specified\" && exit 1"

},
"author": "",
"license": "ISC",
"devDependencies": {

"gulp": "^3.9.1",
"gulp-clean": "^0.3.2",
"gulp-concat": "^2.6.1",
"gulp-connect": "^5.0.0",
"gulp-cssmin": "^0.1.7",
"gulp-imagemin": "^3.2.0",
"gulp-less": "^3.3.0",
"gulp-load-plugins": "^1.5.0",
"gulp-uglify": "^2.1.2",
"open": "^0.0.5"

}
}

求教怎么在别人电脑上代开gulp+bower配置的webapp项目

解决方案

首先是环境配置,因为 bower,gulp 都是基于Nodejs的。
所以,第一步是 安装NodeJS

第二步,在当前项目下执行npm install 命令,安装项目依赖模块。
第三步,bower 这里没有直接使用。TA只是用来安装第三方库的,所以可以选择性安装npm install bower -g
第四步,执行gulp 命令.项目工程下应该有个 gulpfile.js 文件。查看里面的 代码找到如下类似代码

gulp.task('compile',function(){})

这段代码是gulp 定义任务的代码,你确保gulp(如果执行的时候,提示 gulp 不是命令之类的,请全局安装gulp npm install -g gulp) 正确安装的情况下,执行 gulp compile 即可。

这篇关于javascript - 如何在别人电脑上打开,gulp+bower配置的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆