-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
87 lines (76 loc) · 2.56 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
module.exports = function (grunt) {
'use strict';
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt, {
pattern: ['grunt-*']
});
var pkgjson = require('./package.json');
// Configuration
grunt.initConfig({
config: {
name: 'react-playground',
pkg: pkgjson,
app: 'src',
dist: 'dist',
bower: 'bower_components/**',
pub: 'public',
assets: 'assets'
},
pkg: this.config.pkg,
clean: {
dist: '<%= config.dist %>',
pub: '<%= config.pub %>'
},
bump: {
options: {
files: ['bower.json', 'package.json'],
commitMessage: 'Release %VERSION%',
commitFiles: ['bower.json', 'package.json'],
createTag: true,
tagName: '%VERSION%',
tagMessage: 'Version %VERSION%',
pushTo: 'origin'
}
},
sass: {
dev: {
options: {
style: 'expanded',
sourcemap: true
},
files: {
'<%= config.pub %>/third-party-non-bundled.css': '<%= config.app %>/scss/third-party-non-bundled.scss'
}
},
min: {
options: {
style: 'compressed',
sourcemap: false
},
files: {
'<%= config.dist %>/css/appSpider.dev.min.css': '<%= config.app %>/scss/main.min.scss'
}
}
},
copy: {
assets: {
files: [
{src : '<%= config.assets %>/*', dest : '<%= config.pub %>/', expand: true, flatten: true},
{src : 'node_modules/react-bootstrap-table/css/react-bootstrap-table.min.css', dest : '<%= config.pub %>/', expand: true, flatten: true},
{src : 'node_modules/react-dragula/dist/dragula.min.css', dest : '<%= config.pub %>/', expand: true, flatten: true}
]
}
},
shell: {
devServer: {
command: ['node server.js', 'npm run watch'].join('&')
},
webpack: {
command: 'npm run build'
}
}
});
grunt.registerTask('build', ['clean', 'sass:min', 'shell:webpack']);
grunt.registerTask('default', ['build']);
grunt.registerTask('dev', ['clean', 'sass:dev', 'copy', 'shell:devServer']);
};