-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
126 lines (120 loc) · 4.26 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
var path = require('path');
module.exports = function(grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
nodemon: {
server: {
script: './bin/lorrainesposto-www',
options: {
nodeArgs: [],
env: {
"NODE_ENV": "development"
},
watch: ['*.*'],
delay: 300,
callback: function (nodemon) {
nodemon.on('log', function (event) {
console.log(event.colour);
});
nodemon.on('restart', function () {
// Delay before server listens on port
setTimeout(function() {
require('fs').writeFileSync('.rebooted-lorrainesposto', 'rebooted');
}, 1000);
});
}
}
},
api: {
script: './bin/api-www',
options: {
nodeArgs: [],
env: {
"NODE_ENV": "development"
},
watch: ['*.*'],
delay: 300,
callback: function (nodemon) {
nodemon.on('log', function (event) {
console.log(event.colour);
});
nodemon.on('restart', function () {
// Delay before server listens on port
setTimeout(function() {
require('fs').writeFileSync('.rebooted-api', 'rebooted');
}, 1000);
});
}
}
}
},
concat: {
default: {
src: [
'lorrainesposto/public/src/scss/recipe.scss',
//'public/bower_components/normalize-css/normalize.css',
//'public/bower_components/font-awesome/css/font-awesome.css',
//'public/bower_components/pure/pure-min.css'
],
dest: 'lorrainesposto/public/src/scss/build.scss',
}
},
sass: {
options: {
sourceMap: true,
},
dev: {
files: {
'lorrainesposto/public/src/css/build.css': 'lorrainesposto/public/src/scss/build.scss'
}
},
dist: {
files: {
'lorrainesposto/public/dist/css/build.css': 'lorrainesposto/public/src/scss/build.scss'
}
}
},
watch: {
sass: {
files: ['**/*.scss'],
tasks: ['concat', 'sass:dev']
},
browserify: {
files: ['lorrainesposto/**/*.{jsx,js}', '!lorrainesposto/public/*/js/components.js'],
tasks: ['browserify:dev']
},
nodemon: {
files: ['.rebooted-*']
}
},
concurrent: {
server: ["nodemon:server", "watch"],
api: ["nodemon:api"],
options: {
logConcurrentOutput: true
}
},
browserify: {
options: {
transform: [
["babelify", {
presets: ['react', 'es2015'],
plugins: ['transform-react-jsx']
}],
'reactify'
]
},
dev: {
src: ['lorrainesposto/routes/index.jsx', 'lorrainesposto/components/client/Browser.jsx'],
dest: 'lorrainesposto/public/src/js/components.js'
},
dist: {
src: ['lorrainesposto/routes/index.jsx'],
dest: 'lorrainesposto/public/dist/js/components.js'
}
}
});
grunt.registerTask('style', ['concat', 'sass:dev']);
grunt.registerTask("server", ["concurrent:server"]);
grunt.registerTask("api", ["concurrent:api"]);
};