-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
107 lines (96 loc) · 2.52 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
'use strict';
module.exports = function( grunt ) {
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
project: {
src : {
scss : [ 'src/scss' ],
js : [ 'src/js' ],
},
dist : {
css : [ 'dist/css' ],
js : [ 'dist/js' ],
}
},
sass: {
options: {
loadPath: [
require( 'node-bourbon' ).includePaths,
]
},
dist: {
options: {
style: 'expanded', // nested, compact, compressed, expanded
//sourcemap: 'none' // auto, file, inline, none
},
files: {
'<%= project.dist.css %>/selby.min.css': [ '<%= project.src.scss %>/selby.scss' ],
'<%= project.dist.css %>/example.min.css': [ '<%= project.src.scss %>/example.scss' ]
}
}
},
uglify: {
options: {
banner: '/*! \n * <%= pkg.name %> v<%= pkg.version %>\n * <%= pkg.repo %>\n * \n * Copyright (c) 2018 Derek Cavaliero @ WebMechanix\n * \n * Date: <%= grunt.template.today("yyyy-mm-dd HH:MM:ss Z") %> \n */\n',
},
dist: {
options: {
beautify: false, // minify file when set to false
compress: true, // renames variables and all that
mangle: true,
compress: {
drop_console: true
}
},
files: {
'<%= project.dist.js %>/jquery.selby.min.js': [
'<%= project.src.js %>/jquery.selby.js'
]
}
},
dev: {
options: {
beautify: true, // minify file when set to false
compress: false, // renames variables and all that
mangle: false,
compress: {
drop_console: false
}
},
files: {
'<%= project.dist.js %>/jquery.selby.js': [
'<%= project.src.js %>/jquery.selby.js'
]
}
}
},
watch: {
grunt: {
files : [ 'Gruntfile.js' ],
tasks : [ 'build' ]
},
options: {
livereload : true
},
sass: {
files : [ '<%= project.src.scss %>/**/*.scss' ],
tasks : [ 'sass' ],
exclude : [ '!**/node_modules/**', '!**/bower_components/**' ]
},
scripts: {
files : [ '<%= project.src.js %>/**/*.js' ],
tasks : [ 'uglify' ],
exclude : [ '!**/node_modules/**', '!**/bower_components/**' ]
},
theme: {
files : ['**/*.html'],
exclude : ['!**/node_modules/**', '!**/bower_components/**' ]
}
},
});
grunt.loadNpmTasks( 'grunt-contrib-sass' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.registerTask( 'build', [ 'sass', 'uglify' ] );
grunt.registerTask( 'default', [ 'build', 'watch' ] );
}