This repository was archived by the owner on Sep 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGruntfile.js
More file actions
52 lines (48 loc) · 1.52 KB
/
Gruntfile.js
File metadata and controls
52 lines (48 loc) · 1.52 KB
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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
// the banner is inserted at the top of the output
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
build: {
src: 'src/<%= pkg.name %>.js',
dest: 'dist/<%= pkg.name %>.min.js'
}
},
jshint: { //docs: http://www.jshint.com/docs/options/
src: ['src/*.js'],
options: {
curly: true,
eqeqeq: true,
eqnull: true,
browser: true
}
},
mocha: {
test: {
src: ['test/test.html'],
options: {
run: false
}
}
},
copy: {
main: {
files: [
{cwd: 'src/', src: '*.js', dest: 'dist/', expand: true},
{cwd: 'dist/', src: '*.min.js', dest: 'examples/js/lib/', expand: true}
]
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-contrib-copy');
// Default task(s).
grunt.registerTask('default', ['jshint', 'mocha', 'uglify', 'copy']);
};