-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathGruntfile.js
69 lines (58 loc) · 1.91 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
module.exports = function(grunt) {
var banner = '/*!\n' +
' * <%= pkg.name %>\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> - <%= pkg.author.email %> | <%= pkg.author.web %>\n' +
' * Licensed under the MIT license.\n' +
' * <%= pkg.repository.url %>\n' +
' * @projectDescription <%= pkg.description %>\n' +
' * @author <%= pkg.author.name %>\n' +
' * @version v<%= pkg.version %>\n' +
' */\n';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
banner: banner
},
build: {
src: ['src/js/jquery.stacky.js'],
dest: 'dist/js/<%= pkg.name %>.js'
}
},
// configure jshint to validate js files
jshint: {
options: {
reporter: require('jshint-stylish')
},
all: ['src/js/*.js']
},
// configure uglify to minify js files
uglify: {
options: {
banner: banner
},
build: {
files: {
'dist/js/<%= pkg.name %>.min.js': 'dist/js/<%= pkg.name %>.js'
}
}
},
// configure sass to compile, concat and minify css files
sass: {
dist: {
options: {
style: 'expanded',
sourcemap: 'none'
},
src: 'src/sass/styles.scss',
dest: 'dist/css/jquery.stacky.css'
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.registerTask('default', ['concat', 'uglify', 'sass']);
};