-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
47 lines (43 loc) · 1.12 KB
/
Gruntfile.js
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
module.exports = function(grunt) {
// Load grunt tasks automatically
// Configurable paths for the application
var appConfig = {
app: require('./bower.json').appPath || 'app',
dist: 'dist'
};
grunt.initConfig({
wiredep: {
task: {
src: ['app/index.html']
}
},
connect: {
server: {
options: {
keepalive: true,
port: 9001,
base: 'app',
open: true,
livereload: {
options: {
middleware: function (connect) {
var middlewares = [
//Enable CORS
connect().use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', '*');
next();
})
];
return middlewares;
}
}
}
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-wiredep');
grunt.registerTask('default', ['wiredep']);
};