|
|
@ -33,38 +33,6 @@ var styles = [ |
|
|
|
'style.css' |
|
|
|
'style.css' |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
var src_lite = 'src-lite/'; |
|
|
|
|
|
|
|
var dest_lite = 'dist-lite/'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var scripts_lite = [ |
|
|
|
|
|
|
|
'src-lite/js/app.js', |
|
|
|
|
|
|
|
'src-lite/js/controllers.js', |
|
|
|
|
|
|
|
'src-lite/js/filters.js', |
|
|
|
|
|
|
|
'src-lite/js/directives.js', |
|
|
|
|
|
|
|
'src-lite/js/script.js' |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var vendor_lite = [ |
|
|
|
|
|
|
|
'dist-lite/js/lib/jquery-1.11.3.min.js', |
|
|
|
|
|
|
|
'dist-lite/js/lib/bootstrap.min.js', |
|
|
|
|
|
|
|
'dist-lite/js/lib/angular.min.js', |
|
|
|
|
|
|
|
'dist-lite/js/lib/lodash.min.js', |
|
|
|
|
|
|
|
'dist-lite/js/lib/d3.min.js', |
|
|
|
|
|
|
|
'dist-lite/js/lib/d3.tip.min.js', |
|
|
|
|
|
|
|
'dist-lite/js/lib/moment.min.js', |
|
|
|
|
|
|
|
'dist-lite/js/lib/moment.en.min.js', |
|
|
|
|
|
|
|
'dist-lite/js/lib/toastr.min.js', |
|
|
|
|
|
|
|
'dist-lite/js/lib/jquery.sparkline.min.js', |
|
|
|
|
|
|
|
'dist-lite/js/lib/primus.min.js' |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var styles_lite = [ |
|
|
|
|
|
|
|
'bootstrap.min.css', |
|
|
|
|
|
|
|
'minimal-icons-embedded.css', |
|
|
|
|
|
|
|
'toastr.min.css', |
|
|
|
|
|
|
|
'style.css' |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = function(grunt) { |
|
|
|
module.exports = function(grunt) { |
|
|
|
grunt.initConfig({ |
|
|
|
grunt.initConfig({ |
|
|
|
pkg: grunt.file.readJSON('package.json'), |
|
|
|
pkg: grunt.file.readJSON('package.json'), |
|
|
@ -72,9 +40,6 @@ module.exports = function(grunt) { |
|
|
|
build: ['dist'], |
|
|
|
build: ['dist'], |
|
|
|
cleanup_js: ['dist/js/*.*', '!dist/js/netstats.*'], |
|
|
|
cleanup_js: ['dist/js/*.*', '!dist/js/netstats.*'], |
|
|
|
cleanup_css: ['dist/css/*.css', '!dist/css/netstats.*.css'], |
|
|
|
cleanup_css: ['dist/css/*.css', '!dist/css/netstats.*.css'], |
|
|
|
build_lite: ['dist-lite'], |
|
|
|
|
|
|
|
cleanup_js_lite: ['dist-lite/js/*.*', '!dist-lite/js/netstats.*'], |
|
|
|
|
|
|
|
cleanup_css_lite: ['dist-lite/css/*.css', '!dist-lite/css/netstats.*.css'] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
jade: { |
|
|
|
jade: { |
|
|
|
build: { |
|
|
|
build: { |
|
|
@ -87,17 +52,6 @@ module.exports = function(grunt) { |
|
|
|
files: { |
|
|
|
files: { |
|
|
|
'dist/index.html': 'src/views/index.jade' |
|
|
|
'dist/index.html': 'src/views/index.jade' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
build_lite: { |
|
|
|
|
|
|
|
options: { |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
debug: false, |
|
|
|
|
|
|
|
pretty: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
files: { |
|
|
|
|
|
|
|
'dist-lite/index.html': 'src-lite/views/index.jade' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
copy: { |
|
|
|
copy: { |
|
|
@ -131,37 +85,6 @@ module.exports = function(grunt) { |
|
|
|
dest: 'dist/js/lib' |
|
|
|
dest: 'dist/js/lib' |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
|
}, |
|
|
|
|
|
|
|
build_lite: { |
|
|
|
|
|
|
|
files: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
expand: true, |
|
|
|
|
|
|
|
cwd: 'src-lite/fonts/', |
|
|
|
|
|
|
|
src: ['minimal-*.*'], |
|
|
|
|
|
|
|
dest: 'dist-lite/fonts/', |
|
|
|
|
|
|
|
filter: 'isFile' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
expand: true, |
|
|
|
|
|
|
|
cwd: 'src-lite/images/', |
|
|
|
|
|
|
|
src: ['*.ico'], |
|
|
|
|
|
|
|
dest: 'dist-lite/', |
|
|
|
|
|
|
|
filter: 'isFile' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
expand: true, |
|
|
|
|
|
|
|
cwd: 'src-lite/css/', |
|
|
|
|
|
|
|
src: styles, |
|
|
|
|
|
|
|
dest: 'dist-lite/css/', |
|
|
|
|
|
|
|
filter: 'isFile' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
expand: true, |
|
|
|
|
|
|
|
cwd: 'src-lite/js/lib/', |
|
|
|
|
|
|
|
src: ['*.*'], |
|
|
|
|
|
|
|
dest: 'dist-lite/js/lib' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
cssmin: { |
|
|
|
cssmin: { |
|
|
@ -172,14 +95,6 @@ module.exports = function(grunt) { |
|
|
|
src: ['*.css', '!*.min.css'], |
|
|
|
src: ['*.css', '!*.min.css'], |
|
|
|
dest: 'dist/css/' |
|
|
|
dest: 'dist/css/' |
|
|
|
}] |
|
|
|
}] |
|
|
|
}, |
|
|
|
|
|
|
|
build_lite: { |
|
|
|
|
|
|
|
files: [{ |
|
|
|
|
|
|
|
expand: true, |
|
|
|
|
|
|
|
cwd: 'dist-lite/css', |
|
|
|
|
|
|
|
src: ['*.css', '!*.min.css'], |
|
|
|
|
|
|
|
dest: 'dist-lite/css/' |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
concat: { |
|
|
|
concat: { |
|
|
@ -212,36 +127,6 @@ module.exports = function(grunt) { |
|
|
|
css: { |
|
|
|
css: { |
|
|
|
src: ['dist/css/*.min.css', 'dist/css/*.css'], |
|
|
|
src: ['dist/css/*.min.css', 'dist/css/*.css'], |
|
|
|
dest: 'dist/css/netstats.min.css' |
|
|
|
dest: 'dist/css/netstats.min.css' |
|
|
|
}, |
|
|
|
|
|
|
|
vendor_lite: { |
|
|
|
|
|
|
|
options: { |
|
|
|
|
|
|
|
sourceMap: false, |
|
|
|
|
|
|
|
sourceMapIncludeSources: true, |
|
|
|
|
|
|
|
sourceMapIn: ['dist-lite/js/lib/*.map'] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
src: vendor_lite, |
|
|
|
|
|
|
|
dest: 'dist-lite/js/vendor.min.js' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
scripts_lite : { |
|
|
|
|
|
|
|
options: { |
|
|
|
|
|
|
|
separator: ';\n', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
src: scripts_lite, |
|
|
|
|
|
|
|
dest: 'dist-lite/js/app.js' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
netstats_lite: { |
|
|
|
|
|
|
|
options: { |
|
|
|
|
|
|
|
sourceMap: false, |
|
|
|
|
|
|
|
sourceMapIncludeSources: true, |
|
|
|
|
|
|
|
sourceMapIn: ['dist-lite/js/vendor.min.js.map', 'dist-lite/js/app.min.js.map'] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
src: ['<%= concat.vendor_lite.dest %>', '<%= uglify.app_lite.dest %>'], |
|
|
|
|
|
|
|
dest: 'dist-lite/js/netstats.min.js', |
|
|
|
|
|
|
|
nonull: true, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
css_lite: { |
|
|
|
|
|
|
|
src: ['dist-lite/css/*.min.css', 'dist-lite/css/*.css'], |
|
|
|
|
|
|
|
dest: 'dist-lite/css/netstats.min.css' |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
uglify: { |
|
|
|
uglify: { |
|
|
@ -253,15 +138,6 @@ module.exports = function(grunt) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
dest: 'dist/js/app.min.js', |
|
|
|
dest: 'dist/js/app.min.js', |
|
|
|
src: ['<%= concat.scripts.dest %>'] |
|
|
|
src: ['<%= concat.scripts.dest %>'] |
|
|
|
}, |
|
|
|
|
|
|
|
app_lite: { |
|
|
|
|
|
|
|
options: { |
|
|
|
|
|
|
|
mangle: false, |
|
|
|
|
|
|
|
sourceMap: false, |
|
|
|
|
|
|
|
sourceMapIncludeSources: true |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
dest: 'dist-lite/js/app.min.js', |
|
|
|
|
|
|
|
src: ['<%= concat.scripts_lite.dest %>'] |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -274,7 +150,6 @@ module.exports = function(grunt) { |
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify'); |
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify'); |
|
|
|
|
|
|
|
|
|
|
|
grunt.registerTask('default', ['clean:build', 'clean:cleanup_js', 'clean:cleanup_css', 'jade:build', 'copy:build', 'cssmin:build', 'concat:vendor', 'concat:scripts', 'uglify:app', 'concat:netstats', 'concat:css', 'clean:cleanup_js', 'clean:cleanup_css']); |
|
|
|
grunt.registerTask('default', ['clean:build', 'clean:cleanup_js', 'clean:cleanup_css', 'jade:build', 'copy:build', 'cssmin:build', 'concat:vendor', 'concat:scripts', 'uglify:app', 'concat:netstats', 'concat:css', 'clean:cleanup_js', 'clean:cleanup_css']); |
|
|
|
grunt.registerTask('lite', ['clean:build_lite', 'clean:cleanup_js_lite', 'clean:cleanup_css_lite', 'jade:build_lite', 'copy:build_lite', 'cssmin:build_lite', 'concat:vendor_lite', 'concat:scripts_lite', 'uglify:app_lite', 'concat:netstats_lite', 'concat:css_lite', 'clean:cleanup_js_lite', 'clean:cleanup_css_lite']); |
|
|
|
grunt.registerTask('build', 'default'); |
|
|
|
grunt.registerTask('build', 'default'); |
|
|
|
grunt.registerTask('all', 'default'); |
|
|
|
grunt.registerTask('all', ['default', 'lite']); |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|