-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
executable file
·114 lines (104 loc) · 2.83 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-ts");
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-text-replace');
grunt.initConfig({
ts: {
kurst: {
src: ['src/**/*.ts'],
outDir:'bin/js',
options: {
target: 'es5',
sourcemap: false,
declaration: false,
comments: false,
module: 'amd'
}
}
},
requirejs: {
svg: {
options: {
baseUrl: "bin/js/",
mainConfigFile: "bin/js/config.js",
name: "SVGTestStartup",
out: "release/js/SVGTest.js",
optimize:'none',
uglify2: {
compress: {
sequences: true
},
warnings: false,
mangle: true
}
}
},
svgFFTTest: {
options: {
baseUrl: "bin/js/",
mainConfigFile: "bin/js/config.js",
name: "SVGFFTTestStartup",
out: "release/js/SVGFFTTest.js",
optimize:'none',
uglify2: {
compress: {
sequences: true
},
warnings: false,
mangle: true
}
}
},
svgLoadersTest: {
options: {
baseUrl: "bin/js/",
mainConfigFile: "bin/js/config.js",
name: "SVGLoadersTestStartup",
out: "release/js/SVGLoadersTest.js",
optimize:'none',
uglify2: {
compress: {
sequences: true
},
warnings: false,
mangle: true
}
}
}
},
replace: {
removeextend: {
src: ['bin/js/kurst/**/*.js','bin/js/tests/**/*.js'],
overwrite: true, // overwrite matched source files
replacements: [{
from: /var __extends[\W\S\D]*__\(\);\s};/g,
to: ""
}]
}
},
copy: {
release: {
files: [
{src: ['bin/js/bower_components/requirejs/require.js'], dest: 'release/js/bower_components/requirejs/require.js'},
{src: ['bin/js/vendor/typescript.js'], dest: 'release/js/vendor/typescript.js'},
{expand: true, cwd: 'bin/css/', src: ['**'], dest: 'release/css/', filter: 'isFile'},
{expand: true, cwd: 'bin/assets/', src: ['**'], dest: 'release/assets/', filter: 'isFile'}
]
}
},
watch: {
main: {
files: ['**/*.ts'],
tasks: ['ts:kurst' ,'replace:removeextend' ],
options: {
spawn: false
}
}
}
});
grunt.registerTask('default', [ 'ts:kurst' , 'replace:removeextend']);
grunt.registerTask('watch-main', [ 'watch:main' ]);
grunt.registerTask('release', [ 'ts:kurst' , 'replace:removeextend' , 'requirejs' , 'copy:release']);
};