Commit 32f7afc1 authored by Jinqn's avatar Jinqn

修改grunt,实现src代码改变,自动合并压缩,并刷新页面

parent 785e4438
/*global module:false*/
/*-----------------------------------------------------
* livereload Default Setting
*-----------------------------------------------------*/
'use strict';
var path = require('path');
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
/*-----------------------------------------------------
* Module Setting
*-----------------------------------------------------*/
module.exports = function (grunt) {
var banner = '/*!\n' +
......@@ -50,28 +59,54 @@ module.exports = function (grunt) {
},
uglify: {
options: {
},
minimize: {
files: {
'dist/kityminder.all.min.js': 'dist/kityminder.all.js'
}
}
},
/* Start [Task liverload] ------------------------------------*/
livereload: {
port: 35729 // Default livereload listening port.
},
connect: {
livereload: {
options: {
hostname: '*',
port: 9001,
base: '.',
middleware: function(connect, options, middlewares) {
return [
lrSnippet,
connect.static(options.base.toString()),
connect.directory(options.base.toString())
]
}
}
}
},
regarde: {
js:{
files: 'src/**/*.js',
tasks: ['default', 'livereload']
}
}
/* End [Task liverload] ------------------------------------*/
});
// These plugins provide necessary tasks.
/* [Build plugin & task ] ------------------------------------*/
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
// Default task.
// Build task(s).
grunt.registerTask( 'default', [ 'concat:js', 'uglify:minimize' ] );
/* [liverload plugin & task ] ------------------------------------*/
grunt.loadNpmTasks('grunt-regarde');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-livereload');
grunt.registerTask('live', ['livereload-start', 'connect', 'regarde']);
};
......@@ -8,7 +8,7 @@
<script src="social.js" charset="utf-8"></script>
<script src="../kity/dist/kitygraph.all.js" charset="utf-8"></script>
<script src="../configure.js" charset="utf-8"></script>
<script src="../dist/dev.php" charset="utf-8"></script>
<script src="./kityminder.all.min.js" charset="utf-8"></script>
<script src="../lang/zh-cn/zh-cn.js" charset="utf-8"></script>
<link href="../themes/default/css/import.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" href="social.css">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment