grunt scripts
grunt scripts -env=dist
| /*global module:false require:true*/ | |
| module.exports = function(grunt) { | |
| "use strict"; | |
| grunt.loadNpmTasks('grunt-contrib-concat'); | |
| grunt.loadNpmTasks('grunt-contrib-uglify'); | |
| // set option | |
| grunt.option('env', typeof grunt.option('env') !== 'undefined' ? grunt.option('env') : 'dev'); | |
| var scripts = grunt.file.readJSON('configs/scripts.json'); | |
| // Project configuration. | |
| grunt.initConfig({ | |
| concat: { | |
| scripts_board: { files: scripts.board }, | |
| }, | |
| uglify: { | |
| scripts_board: { files: scripts.board }, | |
| } | |
| }); | |
| var task_scripts = (grunt.option('env') === 'dist' ? 'uglify' : 'concat'); | |
| grunt.registerTask('scripts', [ task_scripts + ':scripts_board']); | |
| }; |