-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgruntfile.js
More file actions
64 lines (63 loc) · 2.33 KB
/
Copy pathgruntfile.js
File metadata and controls
64 lines (63 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Gruntfile with the configuration of grunt-express and grunt-open. No livereload yet!
module.exports = function(grunt) {
// Load Grunt tasks declared in the package.json file
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Configure Grunt
grunt.initConfig({
// Grunt express - our webserver
// https://www.npmjs.com/package/grunt-express
express: {
all: {
options: {
port: 9000,
hostname: "localhost",
bases: ['./app'], // Replace with the directory you want the files served from
// Make sure you don't use `.` or `..` in the path as Express
// is likely to return 403 Forbidden responses if you do
// http://stackoverflow.com/questions/14594121/express-res-sendfile-throwing-forbidden-error
}
}
},
// grunt-browserify will monitor the projects files, jsx transpile them and concatenate to the one file : app/js/build/app.built.js
// https://www.npmjs.com/package/grunt-browserify
browserify: {
options: {
transform: [require('grunt-react').browserify],
browserifyOptions: {
debug: true
}
},
client: {
src: ['app/js/src/*.js'],
dest: 'app/js/build/app.built.js'
}
},
// grunt-watch will monitor the projects files
// https://www.npmjs.com/package/grunt-contrib-watch
watch: {
all: {
files: ['app/js/src/*.js'],
tasks: ['browserify'],
options: {
livereload: true
}
}
},
// Grunt Wiredep - dInject dependancies to index.html
// https://www.npmjs.com/package/grunt-wiredep
wiredep: {
task: {
ignorePath: 'public/',
cwd: 'public/vendor',
src: ['views/**/*.handlebars']
}
}
});
// Creates the `server` task
grunt.registerTask('server', [
'express',
'watch'
]);
//wire in bower dependancies to index.html file
grunt.registerTask('builddep', ['wiredep']);
};