]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - Gruntfile.js
Update node modules
[github/Chocobozzz/PeerTube.git] / Gruntfile.js
1 'use strict'
2
3 module.exports = function (grunt) {
4 var paths = {
5 dist: 'dist',
6 jade: 'views/**/**/*.jade',
7 css: 'public/stylesheets/*.css',
8 scss: 'public/stylesheets/application.scss',
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 }
34 }
35 },
36 concurrent: {
37 options: {
38 logConcurrentOutput: true
39 },
40 dev: [ 'watch:livereload', 'watch:sass', 'express:dev' ]
41 },
42 copy: {
43 dev: {
44 cwd: 'node_modules/bootstrap-sass/assets/',
45 src: [ 'fonts/bootstrap/*' ],
46 expand: true,
47 dest: paths.vendor
48 }
49 },
50 clean: {
51 dev: {
52 files: [{
53 dot: true,
54 src: [
55 paths.browserified, 'public/stylesheets/global.css', paths.vendor
56 ]
57 }]
58 }
59 },
60 express: {
61 dev: {
62 options: {
63 script: paths.server,
64 harmony: true,
65 port: 9000,
66 node_env: 'development',
67 debug: true,
68 background: false
69 }
70 }
71 },
72 sass: {
73 options: {
74 includePaths: [ 'node_modules/bootstrap-sass/assets/stylesheets/' ]
75 },
76 dev: {
77 files: {
78 'public/stylesheets/global.css': paths.scss
79 }
80 }
81 },
82 watch: {
83 livereload: {
84 files: [ paths.jade, paths.css, paths.browserified ],
85 tasks: [ ],
86 options: {
87 livereload: true
88 }
89 },
90 sass: {
91 files: [ paths.scss ],
92 tasks: [ 'sass:dev' ]
93 }
94 }
95 })
96
97 // Load automatically all the tasks
98 require('load-grunt-tasks')(grunt)
99
100 // Build client javascript and copy bootstrap dependencies
101 grunt.registerTask('build', [ 'sass:dev', 'newer:browserify:dev', 'newer:copy:dev' ])
102
103 // Start in dev mode (reload front end files without refresh)
104 grunt.registerTask('dev', [ 'sass:dev', 'newer:browserify:dev', 'newer:copy:dev', 'concurrent:dev' ])
105
106 // Clean build
107 grunt.registerTask('clean', [], function () {
108 grunt.loadNpmTasks('grunt-contrib-clean')
109
110 grunt.task.run(
111 'clean:dev'
112 )
113 })
114 }