Add livereload for sass files
This commit is contained in:
parent
3807e27a6d
commit
af82cae07d
61
Gruntfile.js
61
Gruntfile.js
|
@ -33,6 +33,12 @@ module.exports = function (grunt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
concurrent: {
|
||||||
|
options: {
|
||||||
|
logConcurrentOutput: true
|
||||||
|
},
|
||||||
|
dev: [ 'watch:livereload', 'watch:sass', 'express:dev' ]
|
||||||
|
},
|
||||||
copy: {
|
copy: {
|
||||||
dev: {
|
dev: {
|
||||||
cwd: 'node_modules/bootstrap-sass/assets/',
|
cwd: 'node_modules/bootstrap-sass/assets/',
|
||||||
|
@ -59,7 +65,7 @@ module.exports = function (grunt) {
|
||||||
port: 9000,
|
port: 9000,
|
||||||
node_env: 'development',
|
node_env: 'development',
|
||||||
debug: true,
|
debug: true,
|
||||||
background: true
|
background: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -71,57 +77,28 @@ module.exports = function (grunt) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
express: {
|
livereload: {
|
||||||
files: [ paths.main, paths.routes, paths.src ],
|
files: [ paths.jade, paths.css, paths.browserified ],
|
||||||
tasks: [ 'express:dev' ],
|
tasks: [ ],
|
||||||
options: {
|
options: {
|
||||||
livereload: true,
|
livereload: true
|
||||||
spawn: false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dev: {
|
sass: {
|
||||||
files: [ paths.jade, paths.css, paths.browserified ],
|
files: [ paths.scss ],
|
||||||
options: {
|
tasks: [ 'sass:dev' ]
|
||||||
livereload: true,
|
|
||||||
nospawn: false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Build client javascript and copy bootstrap dependencies
|
// Load automatically all the tasks
|
||||||
grunt.registerTask('build', [], function () {
|
require('load-grunt-tasks')(grunt)
|
||||||
grunt.loadNpmTasks('grunt-sass')
|
|
||||||
grunt.loadNpmTasks('grunt-browserify')
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-copy')
|
|
||||||
grunt.loadNpmTasks('grunt-newer')
|
|
||||||
|
|
||||||
// TODO: SASS --> newer
|
// Build client javascript and copy bootstrap dependencies
|
||||||
grunt.task.run(
|
grunt.registerTask('build', [ 'sass:dev', 'newer:browserify:dev', 'newer:copy:dev' ])
|
||||||
'sass:dev',
|
|
||||||
'newer:browserify:dev',
|
|
||||||
'newer:copy:dev'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
// Start in dev mode (reload front end files without refresh)
|
// Start in dev mode (reload front end files without refresh)
|
||||||
grunt.registerTask('dev', [], function () {
|
grunt.registerTask('dev', [ 'sass:dev', 'newer:browserify:dev', 'newer:copy:dev', 'concurrent:dev' ])
|
||||||
grunt.loadNpmTasks('grunt-sass')
|
|
||||||
grunt.loadNpmTasks('grunt-browserify')
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-watch')
|
|
||||||
grunt.loadNpmTasks('grunt-express-server')
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-copy')
|
|
||||||
grunt.loadNpmTasks('grunt-newer')
|
|
||||||
|
|
||||||
// TODO: SASS --> newer
|
|
||||||
grunt.task.run(
|
|
||||||
'sass:dev',
|
|
||||||
'newer:browserify:dev',
|
|
||||||
'newer:copy:dev',
|
|
||||||
'express:dev',
|
|
||||||
'watch'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
// Clean build
|
// Clean build
|
||||||
grunt.registerTask('clean', [], function () {
|
grunt.registerTask('clean', [], function () {
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
"express-validator": "^2.11.0",
|
"express-validator": "^2.11.0",
|
||||||
"grunt": "^0.4.5",
|
"grunt": "^0.4.5",
|
||||||
"grunt-browserify": "^4.0.1",
|
"grunt-browserify": "^4.0.1",
|
||||||
|
"grunt-concurrent": "^2.1.0",
|
||||||
"grunt-contrib-clean": "^0.6.0",
|
"grunt-contrib-clean": "^0.6.0",
|
||||||
"grunt-contrib-copy": "0.8.0",
|
"grunt-contrib-copy": "0.8.0",
|
||||||
"grunt-contrib-watch": "^0.6.1",
|
"grunt-contrib-watch": "^0.6.1",
|
||||||
|
@ -44,6 +45,7 @@
|
||||||
"jade": "^1.10.0",
|
"jade": "^1.10.0",
|
||||||
"jquery": "^2.1.4",
|
"jquery": "^2.1.4",
|
||||||
"js-yaml": "^3.3.1",
|
"js-yaml": "^3.3.1",
|
||||||
|
"load-grunt-tasks": "^3.3.0",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"mongoose": "^4.0.5",
|
"mongoose": "^4.0.5",
|
||||||
"morgan": "^1.5.3",
|
"morgan": "^1.5.3",
|
||||||
|
|
Loading…
Reference in New Issue