-
Notifications
You must be signed in to change notification settings - Fork 19
/
Gruntfile.js
57 lines (49 loc) · 1.19 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
/* global require, module */
var matchdep = require('matchdep');
module.exports = function(grunt){
matchdep.filterDev('grunt-*').forEach(grunt.loadNpmTasks);
matchdep.filterDev('gruntify-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
clean: {
tmp: [ 'tmp/**/*' ]
},
babel: {
options: {
presets: ['latest']
},
testLib: {
expand: true,
cwd: 'lib',
src: [ '**/*.js' ],
dest: 'tmp/lib'
},
tests: {
expand: true,
cwd: 'test',
src: [ '**/*.js', '!fixtures/**/*.js' ],
dest: 'tmp/test'
}
},
eslint: {
all: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*_test.js']
},
browserify: {
dist: {
files: {
'dist/i18n_js_extension.js': ['tmp/lib/extensions/i18n_js_build.js']
}
}
},
copy: {
main: {
cwd: 'tmp/lib/',
src: '**',
dest: 'dist/lib/',
expand: true
}
}
});
grunt.registerTask('test', [ 'clean', 'babel:testLib', 'babel:tests' ]);
grunt.registerTask('default', [ 'babel:testLib', 'babel:tests' ]);
grunt.registerTask('dist', ['test', 'copy', 'browserify']);
};