-
Notifications
You must be signed in to change notification settings - Fork 28
/
Gruntfile.js
81 lines (73 loc) · 1.81 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
/* jshint node:true */
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('dts-generator');
require('grunt-dojo2').initConfig(grunt, {
dtsGenerator: {
options: {
baseDir: 'src',
name: 'dojo-loader'
},
dist: {
options: {
out: 'dist/umd/dojo-loader.d.ts'
},
src: [ '<%= skipTests %>' ]
}
},
/* loader has to build in a slightly different way than the standard Dojo 2 package */
ts: {
tests: {
compilerOptions: {
module: 'umd'
},
include: [ 'tests/**/*.ts', 'typings/index.d.ts', 'src/interfaces.d.ts' ]
},
dist: {
compilerOptions: {
declaration: false,
rootDir: 'src'
}
}
},
typedoc: {
options: {
ignoreCompilerErrors: true // Remove this once compile errors are resolved
}
},
/* loader has minification built into the package, eventually this should be moved to grunt-dojo2 */
uglify: {
dist: {
options: {
banner: '/*! <%= name %>@<%= version %> - Copyright (c) 2016, The Dojo Foundation. ' +
'All rights reserved. */',
sourceMap: true,
sourceMapName: 'dist/umd/loader.min.js.map',
sourceMapIncludeSources: true,
sourceMapIn: 'dist/umd/loader.js.map',
compress: {
dead_code: true,
unsafe: true
}
},
files: {
'dist/umd/loader.min.js': 'dist/umd/loader.js'
}
}
},
intern: {
version: 4
}
});
/* we have to write the dev task from the default because of the need to copy compile the tests differently */
grunt.registerTask('dev', [
'typings:dev',
'tslint',
'clean:dev',
'dojo-ts:dev',
'dojo-ts:tests',
'copy:staticTestFiles'
]);
/* we also have to add the uglify task */
grunt.registerTask('dist', grunt.config.get('distTasks').concat(['uglify:dist', 'dtsGenerator:dist']));
};