forked from hightail/topo-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
81 lines (75 loc) · 1.9 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
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
env: {
dev : {
NODE_ENV : 'development',
PRERENDER_SERVICE_URL: 'http://localhost:3000'
}
},
shell: {
installDependencies: {
command: [
'npm install',
'bower install'
].join('&&'),
options: {
stdout: true
}
}
},
sass: {
options: {
includePaths: [
'./app/client/appearance/base/common/styles'
]
},
default: {
options: {
outputStyle: 'nested'
},
files: {
'./app/client/wilson.css': [
'./app/client/appearance/base/common/styles/app.scss'
]
}
},
dist: {
options: {
outputStyle: 'compressed'
},
files: {
'./app/client/wilson.css': [
'./app/client/appearance/base/common/styles/app.scss'
]
}
}
},
express: {
default: {
options: {
port: process.env.PORT || 5000,
script: 'app/server/app.js',
background: true
}
}
},
watch: {
express: {
files: [ 'app/**/*.{js,json,hbs,html,scss}' ],
tasks: [ 'restartServer' ],
options: {
spawn: false // for grunt-contrib-watch v0.5.0+, "nospawn: true" for lower versions. Without this option specified express won't be reloaded
}
}
}
});
grunt.registerTask('install', ['shell:installDependencies']);
grunt.registerTask('restartServer', ['env:dev', 'sass:dist','express:default']);
grunt.registerTask('server', ['restartServer', 'watch']);
// Default task(s).
grunt.registerTask('default', ['server']);
};