-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
139 lines (135 loc) · 5.3 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: {
css: {
options: {
sassDir: 'scss/',
cssDir: 'stylesheets/',
}
},
fa: {
options: {
sassDir: 'fontawesome/',
cssDir: 'stylesheets/',
}
}
},
concat: {
options: {
separator: '',
},
css: {
src: ['stylesheets/barceloneta.css',
'stylesheets/bootstrap-icons.css',
'stylesheets/complements/jquery.dataTables.css',
'stylesheets/complements/select2.css',
'stylesheets/complements/select2-bootstrap-5-theme.css',
'stylesheets/theme.css'],
dest: 'stylesheets/theme-concat.css',
},
js: {
src: ['js/main/*.js'],
dest: 'js/theme-concat.js',
}
},
cssmin: {
css: {
src : ["stylesheets/theme-concat.css"],
dest : "stylesheets/theme.min.css",
},
fa: {
src : ["stylesheets/fa.css"],
dest : "stylesheets/fa.min.css",
}
},
watch: {
css: {
files: [
'stylesheets/barceloneta.css',
'stylesheets/bootstrap-icons.css',
'stylesheets/complements/*',
'scss/*',
'scss/**/*'
],
tasks: ['compass:css', 'concat:css', 'cssmin:css']
},
fa: {
files: [
'fontawesome/*',
],
tasks: ['compass:fa', 'cssmin:fa']
},
js: {
files: [
'js/main/*'
],
tasks: ['concat:js', 'uglify:mainjs']
}
},
uglify: {
js: {
files: {
'js/contents/accordion_tabs_edit.min.js':
'../../../../../genweb6.core/src/genweb6/core/content/accordion_tabs/accordion_tabs_edit.js',
'js/contents/carousel_edit.min.js':
'../../../../../genweb6.core/src/genweb6/core/content/carousel/carousel_edit.js',
'js/controlpanels/resources.min.js':
'../../../../../genweb6.core/src/genweb6/core/controlpanels/widgets/resources.js',
'js/controlpanels/#_preview.min.js':
'../../../../../genweb6.core/src/genweb6/core/cas/#_preview.js',
'js/portlets/gw-manage-portlets.min.js':
'../../../../../genweb6.core/src/genweb6/core/portlets/manage_portlets/gw-manage-portlets.js',
'js/portlets/new_existing_content.min.js':
'../../../../../genweb6.core/src/genweb6/core/portlets/new_existing_content/new_existing_content.js',
'js/portlets/rss.min.js':
'../../../../../genweb6.core/src/genweb6/core/portlets/rss/rss.js',
'js/templates/multiple_carousel.min.js':
'../../../../../genweb6.core/src/genweb6/core/browser/macros/carousel/multiple_carousel.js',
'js/views/filtered_contents_search.min.js':
'../../../../../genweb6.core/src/genweb6/core/browser/views_templates/filtered_contents_search/filtered_contents_search.js',
'js/dataTables.min.js': 'js/complements/dataTables.js',
'js/select2.min.js': 'js/complements/select2.js',
'js/tinymce_translations.min.js': 'js/tinymce/translations.js',
}
},
mainjs: {
files: {
'js/theme.min.js': 'js/theme-concat.js'
}
}
},
browserSync: {
plone: {
bsFiles: {
src : [
'stylesheets/*.css'
]
},
options: {
watchTask: true,
debugInfo: true,
proxy: "localhost:8080/Plone",
reloadDelay: 3000,
// reloadDebounce: 2000,
online: true
}
}
}
});
// grunt.loadTasks('tasks');
// grunt.loadNpmTasks('grunt-browser-sync');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
// CWD to theme folder
grunt.file.setBase('./src/genweb6/theme/theme');
// Registered tasks: grunt watch
grunt.registerTask('default', ["browserSync:plone", "watch"]);
grunt.registerTask('bsync', ["browserSync:html", "watch"]);
grunt.registerTask('plone-bsync', ["browserSync:plone", "watch"]);
grunt.registerTask('minify', ["uglify:js", "concat:js", "uglify:mainjs"]);
};