-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
60 lines (56 loc) · 1.57 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'assets/js/<%= pkg.name %>.js',
dest: 'dist/<%= pkg.name %>.min.js'
}
},
// Compile sass
sass: {
dist: {
options: {
sourcemap: 'none'
},
files: {
'dist/styles/flickrgal.css' : '_sass/flickrgal.scss'
}
}
},
// Copy raw assets
copy: {
main: {
files: [
{expand: true, flatten: true, src: ['assets/js/*'], dest: 'dist/', filter: 'isFile'},
{expand: true, flatten: true, src: ['_sass/*'], dest: 'dist/styles', filter: 'isFile'},
]
}
},
// make a zip with all the stuff
compress: {
main: {
options: {
archive: 'dist/flickrgal.zip'
},
files: [
{expand: true, cwd: 'dist/', src: ['**', '!*.zip'], dest: '/asd'}
]
}
}
});
// Uglify plugin tasks
grunt.loadNpmTasks('grunt-contrib-uglify');
// Copy plugin tasks
grunt.loadNpmTasks('grunt-contrib-copy');
// Compression plugin tasks
grunt.loadNpmTasks('grunt-contrib-compress');
// Sass Compilation plugin tasks
grunt.loadNpmTasks('grunt-contrib-sass');
// Default task(s).
grunt.registerTask('default', ['uglify', 'sass', 'copy', 'compress']);
};