-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
67 lines (64 loc) · 1.48 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
module.exports = function(grunt) {
var path = require('path');
var PORT = 8003;
grunt.initConfig({
connect: {
client: {
options: {
port: PORT,
base: './src'
}
}
},
react: {
core: {
files: [
{
expand: true,
cwd: 'src/js/sea-modules/app/core/',
src: ['**/*.jsx'],
dest: 'src/js/sea-modules/app/core/',
ext: '.js'
}
]
},
view: {
files: [
{
expand: true,
cwd: 'src/js/sea-modules/app/view/',
src: ['**/*.jsx'],
dest: 'src/js/sea-modules/app/view/',
ext: '.js'
}
]
}
},
watch: {
reactCore: {
files: path.join(process.cwd(), './src/js/sea-modules/app/core/**/*.jsx'),
tasks: ['react:core']
},
reactView: {
files: path.join(process.cwd(), './src/js/sea-modules/app/view/**/*.jsx'),
tasks: ['react:view']
},
js: {
files: path.join(process.cwd(), './src/js/**/*.js'),
options: {
livereload: true
}
}
},
open: {
dev: {
path: 'http://localhost:' + PORT + '/'
}
}
});
grunt.loadNpmTasks('grunt-react');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-open');
grunt.registerTask('default', ['connect', 'open', 'watch']);
};