Grunt - grunt-contrib-connect
快速搭建本地化服务
推荐加强版 : http://www.cnblogs.com/CyLee/p/5331055.html
首先要安装全局的grunt-cli
sudo npm install grunt-cli -g
1,项目中初始化npm文件,项目名不要和【关键词】如grunt重复,一直回车即可
npm init
2,安装grunt和connect
npm install grunt --save-dev
npm install grunt-contrib-connect --save-dev
3,在当前项目根目录创建并且配置Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect:
{
Task_001:
{
options:
{
port:8060,
hostname: 'localhost',
open:true,
keepalive: true,
onCreateServer : function(server,connect,options)
{
console.log(server);
console.log(connect);
console.log(options);
}
}
}
}
});
//#####告诉grunt我们将使用的插件
grunt.loadNpmTasks('grunt-contrib-connect');
//#####告诉grunt我们在终端输入grunt时需要做一些什么
grunt.registerTask('default', ['connect']);
};
4, 在控制台输入grunt即可开启
Grunt - grunt-contrib-connect的更多相关文章
- [Grunt] grunt.template
/** * Created by Answer1215 on 11/15/2014. */ module.exports = function(grunt){ grunt.initConfig({ f ...
- 前端开发 Grunt 之 Connect
在前端开发过程中,我们需要在开发过程中,将开发中的站点部署到服务器上,然后,在浏览器中查看实际的效果,在 Grunt 环境下,可以直接使用集成在 Grunt 中的 Connect 插件完成站点服务器的 ...
- Grunt 之 Connect
前端开发 Grunt 之 Connect 在前端开发过程中,我们需要在开发过程中,将开发中的站点部署到服务器上,然后,在浏览器中查看实际的效果,在 Grunt 环境下,可以直接使用集成在 Grunt ...
- 前端开发 Grunt 之 Connect详解
在前端开发过程中,我们需要在开发过程中,将开发中的站点部署到服务器上,然后,在浏览器中查看实际的效果,在 Grunt 环境下,可以直接使用集成在 Grunt 中的 Connect 插件完成站点服务器的 ...
- Sass和compass 安装 和配合grunt实时显示 [Sass和compass学习笔记]
demo 下载http://vdisk.weibo.com/s/DOlfkrAWjkF/1401192855 为什么要学习Sass和compass ?提高站独立和代码产品化的绝密武器,尤其是程序化cs ...
- [转载]Grunt插件之LiveReload 实现页面自动刷新,所见即所得编辑
配置文件下载 http://vdisk.weibo.com/s/DOlfks4wpIj LiveReload安装前的准备工作: 安装Node.js和Grunt,如果第一次接触,可以参考:Window ...
- (绝对官方好用,快速上手)针对grunt之前写的那篇有些乱,这次总结个清晰的
安装 Grunt基于Node.js,安装之前要先安装Node.js,然后运行下面的命令. sudo npm install grunt-cli -g grunt-cli表示安装的是grunt的命令行界 ...
- 在Grunt task中集成Protractor
Protractor是专为AngularJS应用程序编写的UI自动化测试框架.前端构建有很多构建工具,比如Grunt.Gulp等.一般我们会把这些构建工具作为集成集成的脚本执行工具.所以如果把Prot ...
- Grunt 安装与配置环境
当时学习 Grunt 的时候,真是很头疼.分了两个时间段,学习了两次才硬啃下来,之后才能用在项目中.主要原因我认为是学习资料和文档上面写的太高端了.这类的文档或者资料有个显著特点,上来先简单介绍一下这 ...
- 前端自动化工具 -- grunt 使用简介
grunt作为一个前端构建工具,有资源压缩,代码检查,文件合并等功能. 下面就简单了解grunt的使用. 一.环境配置 grunt是基于nodejs的,所以需要一个 nodejs 环境,未了解的可以 ...
随机推荐
- poj1166
爆搜就可以过,不过我用了迭代加深. 注意每个操作最多进行4次 #include <cstdio> #include <cstdlib> using namespace std; ...
- Java for LeetCode 034 Search for a Range
Given a sorted array of integers, find the starting and ending position of a given target value. You ...
- Tomcat 解决The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
解法: 修改tomcat下的web.xml, 搜索:JspServlet, 增加: <init-param> <param-name>mappedfile</pa ...
- poj 1459 多源多汇点最大流
Sample Input 2 1 1 2 (0,1)20 (1,0)10 (0)15 (1)20 7 2 3 13 (0,0)1 (0,1)2 (0,2)5 (1,0)1 (1,2)8 (2,3)1 ...
- Android快捷键
Android快捷键ALT+/ :在布局文件中,提示输入的内容Shift + Ctrl + / :注释Shift + Ctrl + \ :解除注释
- loj 1156(二分+最大流)
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=26870 思路:由于溢出问题,wa了半天,还以为构图错了呢,查了半天 ...
- 【练习】使用接口回调和handler实现数据加载到listview
代码结构 布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xml ...
- nignx重启启动关闭
http://www.cnblogs.com/jianxie/p/3990377.html 一.启动 cd usr/local/nginx/sbin ./nginx cd usr/local/ngin ...
- Hark的数据结构与算法练习之地精(侏儒)排序
算法说明 地精排序是交换排序的一种,它是冒泡排序的一种改良,我感觉和鸡尾酒排序挺像的. 不同之处是鸡尾酒排序是从小到大,然后再从大到小切换着排序的.而地精排序是上来先从小到大排序,碰到交换到再从大到小 ...
- 用c++处理文件流
#include<bits/stdc++.h> using namespace std; struct Bian { int num; string name; }b[]; int mai ...