envd
Version:
get env info from the user-agent.
81 lines (67 loc) • 2.06 kB
JavaScript
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
name: 'envd',
srcPath: 'src',
assetsPath: 'assets',
distPath: 'build',
clean: ['<%= distPath %>/*'],
copy: {
main: {
files: [{
expand: true,
cwd: './',
src: ['package.json'],
dest: '<%= distPath %>'
}]
}
},
depconcat: {
options: {
separator: '\n'
},
main: {
src: ['<%= srcPath %>/<%= name %>.js'],
dest: '<%= distPath %>/<%= name %>.debug.js'
}
},
uglify: {
main: {
files: [{
expand: true,
cwd: '<%= distPath %>',
src: ['*.debug.js'],
dest: '<%= distPath %>',
ext: '.js'
}]
}
},
watch: {
js: {
files: ['<%= srcPath %>/*.js', '<%= srcPath %>/**/*.js'],
tasks: ['copy', 'depconcat', 'uglify', 'depcombo']
}
},
commonizor: {
js: {
files: [{
expand: true,
cwd: '<%=distPath%>',
src: ['<%=name%>.js'],
dest: '<%=distPath%>',
ext: '.common.js'
}]
}
}
});
grunt.loadNpmTasks('grunt-depconcat');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-commonizor');
grunt.registerTask('dist', ['clean', 'depconcat', 'uglify', 'commonizor', 'copy']);
grunt.registerTask('dev', ['watch']);
grunt.registerTask('default', ['dist']);
}