]>
Commit | Line | Data |
---|---|---|
8c308c2b C |
1 | 'use strict' |
2 | ||
3 | module.exports = function (grunt) { | |
4 | var paths = { | |
6f4e2522 C |
5 | css: 'client/stylesheets/*.css', |
6 | scss: 'client/stylesheets/application.scss', | |
7 | vendor: 'client/stylesheets/vendor', | |
b9a3e09a | 8 | routes: './server/controllers/**/*.js', |
8c308c2b | 9 | main: './server.js', |
8c308c2b C |
10 | img: 'public/images/*.{png,jpg,jpeg,gif,webp,svg}', |
11 | test: 'tests', | |
12 | server: 'server.js' | |
13 | } | |
14 | ||
15 | require('time-grunt')(grunt) | |
16 | ||
17 | // Project Configuration | |
18 | grunt.initConfig({ | |
19 | paths: paths, | |
20 | pkg: grunt.file.readJSON('package.json'), | |
af82cae0 C |
21 | concurrent: { |
22 | options: { | |
23 | logConcurrentOutput: true | |
24 | }, | |
25 | dev: [ 'watch:livereload', 'watch:sass', 'express:dev' ] | |
26 | }, | |
8c308c2b C |
27 | copy: { |
28 | dev: { | |
e5e7517b C |
29 | cwd: 'node_modules/bootstrap-sass/assets/', |
30 | src: [ 'fonts/bootstrap/*' ], | |
8c308c2b C |
31 | expand: true, |
32 | dest: paths.vendor | |
33 | } | |
34 | }, | |
35 | clean: { | |
36 | dev: { | |
37 | files: [{ | |
38 | dot: true, | |
39 | src: [ | |
e5e7517b | 40 | paths.browserified, 'public/stylesheets/global.css', paths.vendor |
8c308c2b C |
41 | ] |
42 | }] | |
8c308c2b C |
43 | } |
44 | }, | |
8c308c2b C |
45 | express: { |
46 | dev: { | |
47 | options: { | |
48 | script: paths.server, | |
49 | harmony: true, | |
50 | port: 9000, | |
51 | node_env: 'development', | |
52 | debug: true, | |
af82cae0 | 53 | background: false |
8c308c2b | 54 | } |
8c308c2b C |
55 | } |
56 | }, | |
e5e7517b | 57 | sass: { |
c1580271 C |
58 | options: { |
59 | includePaths: [ 'node_modules/bootstrap-sass/assets/stylesheets/' ] | |
60 | }, | |
e5e7517b C |
61 | dev: { |
62 | files: { | |
6f4e2522 | 63 | 'client/stylesheets/global.css': paths.scss |
e5e7517b C |
64 | } |
65 | } | |
8c308c2b C |
66 | } |
67 | }) | |
68 | ||
af82cae0 C |
69 | // Load automatically all the tasks |
70 | require('load-grunt-tasks')(grunt) | |
8c308c2b | 71 | |
af82cae0 | 72 | // Build client javascript and copy bootstrap dependencies |
6f4e2522 | 73 | grunt.registerTask('build', [ 'sass:dev', 'newer:copy:dev' ]) |
8c308c2b | 74 | |
8c308c2b C |
75 | // Clean build |
76 | grunt.registerTask('clean', [], function () { | |
77 | grunt.loadNpmTasks('grunt-contrib-clean') | |
78 | ||
79 | grunt.task.run( | |
9d640786 | 80 | 'clean:dev' |
8c308c2b C |
81 | ) |
82 | }) | |
83 | } |