-
Notifications
You must be signed in to change notification settings - Fork 28
/
Gruntfile.js
114 lines (107 loc) · 3.03 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
watch: {
sources: {
files: ['src/jsx/**', 'examples/floating/src/**'],
tasks: ['react'],
options: {
spawn: true,
interrupt: true
}
},
build: {
files: ['build/**'],
tasks: ['concat'],
options: {
spawn: true,
interrupt: true
}
},
reactdev: {
files: ['src/jsx/**', 'examples/floating/src/**'],
tasks: ['react'],
options: {
spawn: false,
interrupt: false
}
},
builddev: {
files: ['build/react-panels.js'],
tasks: ['concat:basic'],
options: {
spawn: false,
interrupt: false
}
},
jsmin: {
files: ['dist/react-panels.js', 'dist/react-panels-with-addons.js'],
tasks: ['uglify'],
options: {
spawn: true,
interrupt: false
}
}
},
react: {
combined_file_output: {
files: {
'build/react-panels.js': [
'src/jsx/styles/themes/flexbox2.js',
'src/jsx/styles/themes/flexbox.js',
'src/jsx/styles/themes/chemical.js',
'src/jsx/styles/base.js',
'src/jsx/utils.js',
'src/jsx/mixins.js',
'src/jsx/panel.js',
'src/jsx/tab.js',
'src/jsx/buttons.js',
'src/jsx/ext.js'
],
'build/addons.js': [
'src/jsx/addons/scrollable-tab-content.js',
'src/jsx/addons/resizable-content.js',
'src/jsx/addons/sticky-button.js'
]
}
}
},
concat: {
basic: {
src: ['src/misc/HEADER', 'build/react-panels.js', 'src/misc/FOOTER'],
dest: 'dist/react-panels.js'
},
addons: {
src: ['src/misc/HEADER', 'build/react-panels.js', 'build/addons.js', 'src/misc/FOOTER'],
dest: 'dist/react-panels-with-addons.js'
},
basicC: {
src: ['src/misc/HEADER_C', 'build/react-panels.js', 'src/misc/FOOTER_C'],
dest: 'index.js'
},
addonsC: {
src: ['src/misc/HEADER_C', 'build/react-panels.js', 'build/addons.js', 'src/misc/FOOTER_C'],
dest: 'addons.js'
}
},
uglify: {
components: {
options: {
sourceMap: true
},
files: {
'dist/react-panels.min.js': ['dist/react-panels.js'],
'dist/react-panels-with-addons.min.js': ['dist/react-panels-with-addons.js']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-react');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.registerTask('default', ['react', 'concat', 'uglify']);
grunt.registerTask('watch-dev', ['watch:reactdev', 'watch:builddev', 'react', 'concat:basic']);
grunt.registerTask('live', ['watch', 'react', 'concat', 'uglify']);
grunt.registerTask('live-dev', ['watch', 'react', 'concat']);
};