forked from kristijan-pajtasev/react-date-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
48 lines (45 loc) · 1.75 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
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-contrib-watch');
// Project configuration.
grunt.initConfig({
exec: {
webpack: {
cmd: function() {
// return 'webpack --optimize-minimize';
return "babel src/js -d temp/ --presets=react,es2015 \n webpack temp/exported.js demo/bundle.js";
}
},
less: {
cmd: function() {
return 'lessc src/less/main.less > demo/style.css';
}
},
dist: {
cmd: function() {
return "rm -r dist/* \n" +
"mkdir dist/style \n" +
"lessc src/less/main.less > dist/style/style.css \n" +
"babel src/js -d dist/npm -b strict --ignore src/js/exported.js --presets=react,es2015\n" +
"babel src/js -d temp/ -b strict --presets=react,es2015 \n" +
"webpack temp/exported.js dist/bundle/react-datepicker.js \n" +
"babel src/js -d temp/ -b strict --presets=react,es2015 \n" +
"webpack temp/exported.js dist/bundle/react-datepicker.min.js --optimize-minimize \n" +
"npm publish";
}
}
},
watch: {
devJs: {
files: ['src/js/**/*.js'],
tasks: ['exec:webpack']
},
devLess: {
files: ['src/less/**/*.less'],
tasks: ['exec:less']
}
}
});
grunt.registerTask('default', ['exec:less', 'exec:webpack', 'watch']);
grunt.registerTask('publish', ['exec:dist']);
};