-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathGruntfile.js
54 lines (53 loc) · 1.51 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module.exports = function(grunt) {
var pkg, version, verParts;
pkg = grunt.file.readJSON('package.json');
verParts = pkg.version.split('.');
version = {
full: pkg.version,
major: verParts[0],
minor: verParts[1],
patch: verParts[2]
};
version.majorMinor = version.major + '.' + version.minor;
// Project configuration.
grunt.initConfig({
pkg: pkg,
jshint: {
src: {
src: ['src/*.js'],
options: {
jshintrc: '.jshintrc'
}
}
},
concat: {
build: {
src: ['src/cuepoint.js','src/core.js'],
dest:'build/<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.title %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'+
'/*! See <%=pkg.github_url %> for details */\n'+
'/*! Author: <%= pkg.author %> <%= pkg.author_email %>*/\n'+
'/*! Released under the <%= pkg.license %> license */\n'
},
build: {
src: 'build/<%= pkg.name %>.js',
dest: 'build/<%= pkg.distName %>.js'
},
dist: {
src: 'build/<%= pkg.name %>.js',
dest: 'dist/<%= pkg.distName %>.js'
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
// Default task(s).
grunt.registerTask('default', ['jshint', 'concat','uglify']);
grunt.registerTask('dist',['jshint', 'concat','uglify:dist']);
};