forked from objectivehtml/Google-Maps-for-Craft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
110 lines (106 loc) · 3.07 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
108
109
110
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
css: {
src: [
'resources/css/fieldtype.css',
],
dest: 'resources/css/app.css',
},
libraries: {
src: [
'resources/js/vendor/underscore.js',
'resources/js/vendor/backbone.js',
'resources/js/vendor/backbone.wreqr.js',
'resources/js/vendor/backbone.babysitter.js',
'resources/js/vendor/backbone.marionette.js',
'resources/js/vendor/handlebars.js',
'resources/js/vendor/jquery.simple-color-picker.js',
'resources/js/vendor/jquery.nouislider.min.js',
],
dest: 'resources/js/libraries.js',
},
app: {
src: [
'resources/js/app/main.js',
'resources/js/app/models/Base.js',
'resources/js/app/models/*.js',
'resources/js/app/views/ItemView.js',
'resources/js/app/views/LayoutView.js',
'resources/js/app/views/*.js',
'resources/js/app/core/*.js',
'resources/js/app/helpers/*.js',
],
dest: 'resources/js/app.js',
},
compiled: {
src: [
'resources/js/libraries.js',
'resources/js/templates.js',
'resources/js/app.js',
],
dest: 'resources/js/app.compiled.js'
}
},
handlebars: {
all: {
files: {
'resources/js/templates.js': [
'resources/js/app/templates/*.handlebars',
'resources/js/app/templates/**/*.handlebars',
]
}
},
},
uglify: {
options: {
mangle: false,
compress: false,
drop_console: true,
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'resources/js/app.min.js': ['resources/js/app.compiled.js'],
// 'resources/js/front-libraries.min.js': ['<%= concat.frontEnd.dest %>'],
// 'resources/js/timeblocker.min.js': 'resources/js/timeblocker.compiled.js',
}
}
},
cssmin: {
app: {
src: 'resources/css/app.css',
dest: 'resources/css/app.min.css'
}
},
watch: {
options: {
livereload: true
},
scripts: {
files: ['<%= concat.app.src %>'],
tasks: ['concat'],
},
css: {
files: ['<%= concat.css.src %>'],
tasks: ['concat'],
},
handlebars: {
files: [
'resources/js/app/templates/*.handlebars',
'resources/js/app/templates/**/*.handlebars'
],
tasks: ['handlebars', 'concat'],
}
},
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-handlebars-compiler');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
// Default task(s).
grunt.registerTask('default', ['handlebars', 'concat', 'uglify', 'cssmin', 'watch']);
};