dist: 'dist',
jade: 'views/**/**/*.jade',
css: 'public/stylesheets/*.css',
+ scss: 'public/stylesheets/application.scss',
vendor: 'public/stylesheets/vendor',
js: 'public/javascripts/*.js',
- src: 'src/*.js',
- routes: 'routes/**/*.js',
+ routes: 'controllers/**/*.js',
main: './server.js',
browserified: 'public/javascripts/bundle.js',
img: 'public/images/*.{png,jpg,jpeg,gif,webp,svg}',
}
}
},
+ concurrent: {
+ options: {
+ logConcurrentOutput: true
+ },
+ dev: [ 'watch:livereload', 'watch:sass', 'express:dev' ]
+ },
copy: {
dev: {
- cwd: 'node_modules/bootstrap/dist/',
- src: [ 'css/*', 'fonts/*' ],
+ cwd: 'node_modules/bootstrap-sass/assets/',
+ src: [ 'fonts/bootstrap/*' ],
expand: true,
dest: paths.vendor
}
files: [{
dot: true,
src: [
- paths.browserified
+ paths.browserified, 'public/stylesheets/global.css', paths.vendor
]
}]
}
port: 9000,
node_env: 'development',
debug: true,
- background: true
+ background: false
}
}
},
- watch: {
- express: {
- files: [ paths.main, paths.routes, paths.src ],
- tasks: [ 'express:dev' ],
- options: {
- livereload: true,
- spawn: false
- }
+ sass: {
+ options: {
+ includePaths: [ 'node_modules/bootstrap-sass/assets/stylesheets/' ]
},
dev: {
+ files: {
+ 'public/stylesheets/global.css': paths.scss
+ }
+ }
+ },
+ watch: {
+ livereload: {
files: [ paths.jade, paths.css, paths.browserified ],
+ tasks: [ ],
options: {
- livereload: true,
- nospawn: false
+ livereload: true
}
+ },
+ sass: {
+ files: [ paths.scss ],
+ tasks: [ 'sass:dev' ]
}
}
})
- // Build client javascript and copy bootstrap dependencies
- grunt.registerTask('build', [], function () {
- grunt.loadNpmTasks('grunt-browserify')
- grunt.loadNpmTasks('grunt-contrib-copy')
- grunt.loadNpmTasks('grunt-newer')
+ // Load automatically all the tasks
+ require('load-grunt-tasks')(grunt)
- grunt.task.run(
- 'newer:browserify:dev',
- 'newer:copy:dev'
- )
- })
+ // Build client javascript and copy bootstrap dependencies
+ grunt.registerTask('build', [ 'sass:dev', 'newer:browserify:dev', 'newer:copy:dev' ])
// Start in dev mode (reload front end files without refresh)
- grunt.registerTask('dev', [], function () {
- grunt.loadNpmTasks('grunt-browserify')
- grunt.loadNpmTasks('grunt-contrib-watch')
- grunt.loadNpmTasks('grunt-express-server')
- grunt.loadNpmTasks('grunt-contrib-copy')
- grunt.loadNpmTasks('grunt-newer')
-
- grunt.task.run(
- 'newer:browserify:dev',
- 'newer:copy:dev',
- 'express:dev',
- 'watch'
- )
- })
+ grunt.registerTask('dev', [ 'sass:dev', 'newer:browserify:dev', 'newer:copy:dev', 'concurrent:dev' ])
// Clean build
grunt.registerTask('clean', [], function () {