This repository was archived by the owner on Jul 11, 2020. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathGruntfile.js
More file actions
89 lines (84 loc) · 2.18 KB
/
Copy pathGruntfile.js
File metadata and controls
89 lines (84 loc) · 2.18 KB
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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: [ "dist/desktop-app" ],
nodewebkit: {
options: {
version: '0.12.3',
build_dir: './dist/desktop-app',
// choose what platforms to compile for here
mac: true,
win: true,
linux32: true,
linux64: false
},
src: ['*','dist/**/*', 'templates/**/*', 'images/**/*']
},
concat:{
options: {
separator: ';'
},
deps:{
src:[
'node_modules/jquery/dist/jquery.js',
'node_modules/angular/angular.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'deps/js/**/*.js'
],
dest: 'dist/js/deps.js'
}
},
browserify:{
project:{
src:[
'js/**/*.js'
],
dest:'dist/js/sams.js'
}
},
cssmin: {
project: {
src: ['css/**/*.css'],
dest: 'dist/css/sams.css',
},
deps: {
src: ['deps/css/**/*.css'],
dest: 'dist/css/deps.css'
}
},
watch:{
dependencesCSS:{
files: ['<%= cssmin.deps.src %>'],
tasks: ['cssmin:deps']
},
projectCSS:{
files: ['<%= cssmin.project.src %>'],
tasks: ['cssmin:project']
},
dependencesJS:{
files: ['<%= concat.deps.src %>'],
tasks: ['concat:deps']
},
projectJS:{
files: ['<%= browserify.project.src %>'],
tasks: ['browserify:project']
},
}
});
// Load the npm installed tasks
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-node-webkit-builder');
grunt.loadNpmTasks('grunt-contrib-clean');
// The default tasks to run when you type: grunt
grunt.registerTask('default', ['concat', 'browserify', 'cssmin']);
grunt.registerTask('nw-export', ['clean', 'concat', 'browserify', 'cssmin', 'nodewebkit']);
grunt.registerTask('watches', [
'watch:dependencesJS',
'watch:dependencesCSS',
'watch:projectJS',
'watch:projectCSS',
]);
};