]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - Gruntfile.js
Fix tests
[github/Chocobozzz/PeerTube.git] / Gruntfile.js
CommitLineData
8c308c2b
C
1'use strict'
2
3module.exports = function (grunt) {
4 var paths = {
5 dist: 'dist',
8c308c2b
C
6 jade: 'views/**/**/*.jade',
7 css: 'public/stylesheets/*.css',
0ac5edd9 8 scss: 'public/stylesheets/application.scss',
8c308c2b
C
9 vendor: 'public/stylesheets/vendor',
10 js: 'public/javascripts/*.js',
11 src: 'src/*.js',
12 routes: 'routes/**/*.js',
13 main: './server.js',
14 browserified: 'public/javascripts/bundle.js',
15 img: 'public/images/*.{png,jpg,jpeg,gif,webp,svg}',
16 test: 'tests',
17 server: 'server.js'
18 }
19
20 require('time-grunt')(grunt)
21
22 // Project Configuration
23 grunt.initConfig({
24 paths: paths,
25 pkg: grunt.file.readJSON('package.json'),
26 browserify: {
27 dev: {
28 src: [ paths.js, '!public/javascripts/bundle.js' ],
29 dest: paths.browserified,
30 options: {
31 browserifyOptions: { 'debug': true },
32 watch: true
33 }
8c308c2b
C
34 }
35 },
af82cae0
C
36 concurrent: {
37 options: {
38 logConcurrentOutput: true
39 },
40 dev: [ 'watch:livereload', 'watch:sass', 'express:dev' ]
41 },
8c308c2b
C
42 copy: {
43 dev: {
e5e7517b
C
44 cwd: 'node_modules/bootstrap-sass/assets/',
45 src: [ 'fonts/bootstrap/*' ],
8c308c2b
C
46 expand: true,
47 dest: paths.vendor
48 }
49 },
50 clean: {
51 dev: {
52 files: [{
53 dot: true,
54 src: [
e5e7517b 55 paths.browserified, 'public/stylesheets/global.css', paths.vendor
8c308c2b
C
56 ]
57 }]
8c308c2b
C
58 }
59 },
8c308c2b
C
60 express: {
61 dev: {
62 options: {
63 script: paths.server,
64 harmony: true,
65 port: 9000,
66 node_env: 'development',
67 debug: true,
af82cae0 68 background: false
8c308c2b 69 }
8c308c2b
C
70 }
71 },
e5e7517b 72 sass: {
c1580271
C
73 options: {
74 includePaths: [ 'node_modules/bootstrap-sass/assets/stylesheets/' ]
75 },
e5e7517b
C
76 dev: {
77 files: {
78 'public/stylesheets/global.css': paths.scss
79 }
80 }
81 },
8c308c2b 82 watch: {
af82cae0 83 livereload: {
8c308c2b 84 files: [ paths.jade, paths.css, paths.browserified ],
af82cae0 85 tasks: [ ],
8c308c2b 86 options: {
af82cae0 87 livereload: true
8c308c2b 88 }
af82cae0
C
89 },
90 sass: {
91 files: [ paths.scss ],
92 tasks: [ 'sass:dev' ]
8c308c2b
C
93 }
94 }
95 })
96
af82cae0
C
97 // Load automatically all the tasks
98 require('load-grunt-tasks')(grunt)
8c308c2b 99
af82cae0
C
100 // Build client javascript and copy bootstrap dependencies
101 grunt.registerTask('build', [ 'sass:dev', 'newer:browserify:dev', 'newer:copy:dev' ])
8c308c2b
C
102
103 // Start in dev mode (reload front end files without refresh)
af82cae0 104 grunt.registerTask('dev', [ 'sass:dev', 'newer:browserify:dev', 'newer:copy:dev', 'concurrent:dev' ])
8c308c2b 105
8c308c2b
C
106 // Clean build
107 grunt.registerTask('clean', [], function () {
108 grunt.loadNpmTasks('grunt-contrib-clean')
109
110 grunt.task.run(
9d640786 111 'clean:dev'
8c308c2b
C
112 )
113 })
114}