-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
92 lines (87 loc) · 2.4 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
'use strict';
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-babel');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.initConfig({
babel: {
options: {
sourceMap: true,
},
dist: {
files: [
{
expand: true,
src: ['./lib/**/*.js', './spec/**/*.js'],
dest: './build/'
}
]
}
},
browserify: {
dist: {
src: ['./build/lib/es6-promish.js'],
dest: './dist/promish-bundle.js',
options: {
browserifyOptions: {
standalone: 'Promish'
}
}
},
spec: {
src: ['./build/spec/browser/promish-spec.js'],
dest: './build/web/promish-spec.js'
},
// node: {
// src: ['./build/lib/es6-promish.js'],
// dest: './dist/promish-node.js',
// options: {
// browserifyOptions: {
// standalone: 'Promish',
// builtins: false,
// commondir: false,
// 'insert-global-vars': '__filename,__dirname',
// detectGlobals: false,
// 'browser-field': false,
// }
// }
// },
},
// concat: {
// options: {
// banner: '/*! Promish <%= grunt.template.today("dd-mm-yyyy") %> */\n'
// },
// dist: {
// src: ['./build/lib/promish-class.js', './build/lib/es6-promish.js'],
// dest: 'dist/es6-promish.js',
// }
// },
copy: {
'promish-node': { src: './build/lib/es6-promish.js', dest: './dist/promish-node.js' },
'promish-class': { src: './build/lib/promish-class.js', dest: './dist/promish-class.js' },
'promish': { src: './build/lib/promish.js', dest: './dist/promish.js' },
},
uglify: {
options: {
banner: '/*! Promish <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'./dist/promish-bundle.min.js': ['./dist/promish-bundle.js'],
}
}
},
jasmine: {
dev: {
src: ['./dist/promish-bundle.js'],
options: {
specs: './build/web/promish-spec.js'
}
}
}
});
grunt.registerTask('build', ['babel', 'browserify', 'copy', 'uglify']);
};