aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2015-12-02 22:16:22 +0100
committerChocobozzz <florian.bigard@gmail.com>2015-12-02 22:16:22 +0100
commitaf82cae07dc568e3cb10acd70113df56eb8b15a9 (patch)
tree96ac99e8f2436efd34117a0fd536c0d759153cb0
parent3807e27a6d1777f5ba4d634fba6f27185ccfac84 (diff)
downloadPeerTube-af82cae07dc568e3cb10acd70113df56eb8b15a9.tar.gz
PeerTube-af82cae07dc568e3cb10acd70113df56eb8b15a9.tar.zst
PeerTube-af82cae07dc568e3cb10acd70113df56eb8b15a9.zip
Add livereload for sass files
-rw-r--r--Gruntfile.js61
-rw-r--r--package.json2
2 files changed, 21 insertions, 42 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index df7958c4f..028a7773d 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -33,6 +33,12 @@ module.exports = function (grunt) {
33 } 33 }
34 } 34 }
35 }, 35 },
36 concurrent: {
37 options: {
38 logConcurrentOutput: true
39 },
40 dev: [ 'watch:livereload', 'watch:sass', 'express:dev' ]
41 },
36 copy: { 42 copy: {
37 dev: { 43 dev: {
38 cwd: 'node_modules/bootstrap-sass/assets/', 44 cwd: 'node_modules/bootstrap-sass/assets/',
@@ -59,7 +65,7 @@ module.exports = function (grunt) {
59 port: 9000, 65 port: 9000,
60 node_env: 'development', 66 node_env: 'development',
61 debug: true, 67 debug: true,
62 background: true 68 background: false
63 } 69 }
64 } 70 }
65 }, 71 },
@@ -71,57 +77,28 @@ module.exports = function (grunt) {
71 } 77 }
72 }, 78 },
73 watch: { 79 watch: {
74 express: { 80 livereload: {
75 files: [ paths.main, paths.routes, paths.src ],
76 tasks: [ 'express:dev' ],
77 options: {
78 livereload: true,
79 spawn: false
80 }
81 },
82 dev: {
83 files: [ paths.jade, paths.css, paths.browserified ], 81 files: [ paths.jade, paths.css, paths.browserified ],
82 tasks: [ ],
84 options: { 83 options: {
85 livereload: true, 84 livereload: true
86 nospawn: false
87 } 85 }
86 },
87 sass: {
88 files: [ paths.scss ],
89 tasks: [ 'sass:dev' ]
88 } 90 }
89 } 91 }
90 }) 92 })
91 93
92 // Build client javascript and copy bootstrap dependencies 94 // Load automatically all the tasks
93 grunt.registerTask('build', [], function () { 95 require('load-grunt-tasks')(grunt)
94 grunt.loadNpmTasks('grunt-sass')
95 grunt.loadNpmTasks('grunt-browserify')
96 grunt.loadNpmTasks('grunt-contrib-copy')
97 grunt.loadNpmTasks('grunt-newer')
98 96
99 // TODO: SASS --> newer 97 // Build client javascript and copy bootstrap dependencies
100 grunt.task.run( 98 grunt.registerTask('build', [ 'sass:dev', 'newer:browserify:dev', 'newer:copy:dev' ])
101 'sass:dev',
102 'newer:browserify:dev',
103 'newer:copy:dev'
104 )
105 })
106 99
107 // Start in dev mode (reload front end files without refresh) 100 // Start in dev mode (reload front end files without refresh)
108 grunt.registerTask('dev', [], function () { 101 grunt.registerTask('dev', [ 'sass:dev', 'newer:browserify:dev', 'newer:copy:dev', 'concurrent:dev' ])
109 grunt.loadNpmTasks('grunt-sass')
110 grunt.loadNpmTasks('grunt-browserify')
111 grunt.loadNpmTasks('grunt-contrib-watch')
112 grunt.loadNpmTasks('grunt-express-server')
113 grunt.loadNpmTasks('grunt-contrib-copy')
114 grunt.loadNpmTasks('grunt-newer')
115
116 // TODO: SASS --> newer
117 grunt.task.run(
118 'sass:dev',
119 'newer:browserify:dev',
120 'newer:copy:dev',
121 'express:dev',
122 'watch'
123 )
124 })
125 102
126 // Clean build 103 // Clean build
127 grunt.registerTask('clean', [], function () { 104 grunt.registerTask('clean', [], function () {
diff --git a/package.json b/package.json
index 0cdd11afe..9b92e0152 100644
--- a/package.json
+++ b/package.json
@@ -35,6 +35,7 @@
35 "express-validator": "^2.11.0", 35 "express-validator": "^2.11.0",
36 "grunt": "^0.4.5", 36 "grunt": "^0.4.5",
37 "grunt-browserify": "^4.0.1", 37 "grunt-browserify": "^4.0.1",
38 "grunt-concurrent": "^2.1.0",
38 "grunt-contrib-clean": "^0.6.0", 39 "grunt-contrib-clean": "^0.6.0",
39 "grunt-contrib-copy": "0.8.0", 40 "grunt-contrib-copy": "0.8.0",
40 "grunt-contrib-watch": "^0.6.1", 41 "grunt-contrib-watch": "^0.6.1",
@@ -44,6 +45,7 @@
44 "jade": "^1.10.0", 45 "jade": "^1.10.0",
45 "jquery": "^2.1.4", 46 "jquery": "^2.1.4",
46 "js-yaml": "^3.3.1", 47 "js-yaml": "^3.3.1",
48 "load-grunt-tasks": "^3.3.0",
47 "mkdirp": "^0.5.1", 49 "mkdirp": "^0.5.1",
48 "mongoose": "^4.0.5", 50 "mongoose": "^4.0.5",
49 "morgan": "^1.5.3", 51 "morgan": "^1.5.3",