Commit d0cd5f63 authored by Madhur's avatar Madhur

more grunt

parent 02ef4f8c
module.exports = function(grunt) module.exports = function(grunt)
{ {
var appConfig = grunt.file.readJSON('package.json') ||
{};
// Project configuration. // Project configuration.
grunt.initConfig( grunt.initConfig(
{ {
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON('package.json'),
uglify: banner: '/*! <%= pkg.description %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
usebanner:
{
dist:
{ {
options: options:
{ {
banner: '/*! <%= pkg.description %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' position: 'top',
banner: '<%= banner %>'
},
files:
{
src: ['dist/js/*.js', 'dist/css/*.css']
}
}
},
connect:
{
server:
{
options:
{
port: 8000,
hostname: '*',
}
}
},
watch:
{
files: ['css/*.css', 'js/*.js', '*.html'],
}, },
copy:
{
main:
{
src: 'img/*',
dest: 'dist/',
},
},
uglify:
{
build: build:
{ {
files: files:
{ {
'dist/emoji.min.js': ['js/app.js', 'js/emojiDirectives.js', 'js/emojiFilters.js', 'js/util.js', 'js/jquery.emojiarea.js', 'js/nanoscroller.js'] 'dist/js/emoji.min.js': ['js/app.js', 'js/emojiDirectives.js', 'js/emojiFilters.js', 'js/util.js', 'js/jquery.emojiarea.js', 'js/nanoscroller.js']
} }
} }
}, },
...@@ -34,15 +76,28 @@ module.exports = function(grunt) ...@@ -34,15 +76,28 @@ module.exports = function(grunt)
cssmin: cssmin:
{ {
target: target:
{
files:
{
'dist/css/emoji.min.css': ['css/nanoscroller.css', 'css/style.css']
}
}
},
compress:
{
main:
{ {
options: options:
{ {
banner: '/*! <%= pkg.description %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' archive: 'emoji.zip'
}, },
files: files: [
{ {
'dist/emoji.min.css': ['css/nanoscroller.css','css/style.css'] src: ['dist/**'],
dest: '/',
} }
]
} }
} }
}); });
...@@ -54,8 +109,12 @@ module.exports = function(grunt) ...@@ -54,8 +109,12 @@ module.exports = function(grunt)
grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-banner'); grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-compress');
// Default task(s). // Default task(s).
grunt.registerTask('default', ['uglify', 'jshint', 'cssmin']); grunt.registerTask('default', ['uglify', 'jshint', 'cssmin', 'usebanner', 'copy', 'compress']);
grunt.registerTask('serve', ['connect', 'watch']);
}; };
#Angular Emoji Popup
\ 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