Skip to content

Instantly share code, notes, and snippets.

@yuichi-tanaka
Created January 10, 2015 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuichi-tanaka/eae3986a4743834bc068 to your computer and use it in GitHub Desktop.
Save yuichi-tanaka/eae3986a4743834bc068 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat:{
hikajs: {
src: [
'source/main.sample.js',
'source/main2.sample.js',
],
dest: 'build/concat.hikarabo.js',
nonull: true
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'build/concat.hikarabo.js',
dest: 'build/<%= pkg.name %>.min.js'
}
},
copy:{
main: {
src:'build/*.min.js',
dest: 'public/js/'
}
},
yuidoc: {
compile: {
name: '<% pkg.name %>',
description: '<%= pkg.description %>',
version: '<%= pkg.version %>',
url: '<%= pkg.homepage %>',
options: {
paths: [
'source/'
],
outdir: 'out/'
}
}
},
gjslint: {
options: {
flags: [
'--flagfile .gjslintrc'
],
reporter: {
name: 'console'
}
},
lib: {
src: [
'source/*.js'
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.loadNpmTasks('grunt-gjslint');
grunt.registerTask('default',['gjslint','concat:hikajs','uglify','copy']);
grunt.registerTask('default:concat', ['concat:hikajs']);
grunt.registerTask('build', ['yuidoc']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment