Skip to content

Commit aafe21d

Browse files
author
Yuta Imaya
committed
support typedarray option in grunt
1 parent 9c411b2 commit aafe21d

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

Gruntfile.js

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,38 @@ module.exports = function(grunt) {
33
grunt.loadNpmTasks('grunt-contrib-concat');
44

55
var license = grunt.file.read('LICENSE_min');
6-
var basefiles = [
7-
'closure-primitives/base.js',
8-
'define/typedarray/hybrid.js',
9-
'src/*.js'
10-
];
6+
var basefiles = [];
117
var config = grunt.file.readJSON("build.json");
128
var targets = Object.keys(config);
139

10+
11+
// basefiles
12+
basefiles.push('closure-primitives/base.js');
13+
14+
switch (grunt.option('typedarray')) {
15+
case 'use':
16+
console.log('USE_TYPEDARRAY=true');
17+
basefiles.push(
18+
'define/typedarray/use.js'
19+
);
20+
break;
21+
case 'no':
22+
console.log('USE_TYPEDARRAY=false');
23+
basefiles.push(
24+
'define/typedarray/no.js'
25+
);
26+
break;
27+
case 'hypbrid': /* FALLTHROUGH */
28+
default:
29+
console.log('USE_TYPEDARRAY=hybrid');
30+
basefiles.push(
31+
'define/typedarray/hybrid.js'
32+
);
33+
break;
34+
}
35+
36+
basefiles.push('src/*.js');
37+
1438
grunt.initConfig({
1539
closureDepsWriter: {
1640
options: {

0 commit comments

Comments
 (0)