Commit c3376bce authored by campaign's avatar campaign

Merge remote-tracking branch 'origin/dev1.1.0' into dev1.1.0

parents f9d6014d 32f7afc1
/*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) { module.exports = function (grunt) {
var banner = '/*!\n' + var banner = '/*!\n' +
...@@ -50,28 +59,54 @@ module.exports = function (grunt) { ...@@ -50,28 +59,54 @@ module.exports = function (grunt) {
}, },
uglify: { uglify: {
options: {
},
minimize: { minimize: {
files: { files: {
'dist/kityminder.all.min.js': 'dist/kityminder.all.js' '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. // These plugins provide necessary tasks.
/* [Build plugin & task ] ------------------------------------*/
grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-uglify');
// Build task(s).
// Default task.
grunt.registerTask( 'default', [ 'concat:js', 'uglify:minimize' ] ); 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 @@ ...@@ -8,7 +8,7 @@
<script src="social.js" charset="utf-8"></script> <script src="social.js" charset="utf-8"></script>
<script src="../kity/dist/kitygraph.all.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="../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> <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 href="../themes/default/css/import.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" href="social.css"> <link rel="stylesheet" href="social.css">
......
...@@ -33,7 +33,10 @@ ...@@ -33,7 +33,10 @@
"devDependencies": { "devDependencies": {
"grunt": "~0.4.1", "grunt": "~0.4.1",
"grunt-contrib-concat": "~0.3.0", "grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.6" "grunt-contrib-uglify": "~0.2.6",
"grunt-regarde": "latest",
"grunt-contrib-connect": "latest",
"grunt-contrib-livereload": "latest"
} }
} }
\ No newline at end of file
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