-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
95 lines (91 loc) · 3.06 KB
/
Copy pathGruntfile.js
File metadata and controls
95 lines (91 loc) · 3.06 KB
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
/**
* Created by malte on 14.10.14.
*/
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-ts');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-string-replace');
grunt.initConfig(
{
pkg: grunt.file.readJSON('package.json'),
clean: {
folder: 'dist/',
folder1: 'compiled/'
},
jasmine: {
tests: {
src: 'compiled/src/**/*.js',
options: {
specs: 'compiled/specs/*Spec.js',
helpers: 'compiled/specs/*Helper.js',
vendor: ['www/lib/angular/angular.min.js', 'www/lib/angular-mocks/angular-mocks.js']
}
}
},
'string-replace': {
inline: {
files: {
'dist/': 'dist/angular-typescript.d.ts'
},
options: {
replacements: [
// place files inline example
{
pattern: '../typings/angularjs/angular.d.ts',
replacement: '../../../../typings/angularjs/angular.d.ts'
}
]
}
}
},
ts: {
// A specific target
build: {
// The source TypeScript files, http://gruntjs.com/configuring-tasks#files
src: ["src/**/*.ts"],
reference: "dist/angular-typescript.ts",
// If specified, generate an out.js file which is the merged js file
out: 'dist/angular-typescript.js',
options :{
declaration: true
}
},
build_separate: {
src: ["src/**/*.ts"],
outDir: 'compiled/src/'
},
tests: {
src: ["specs/**/*.ts"],
outDir: 'compiled/'
}
},
uglify: {
my_target: {
options: {
sourceMap: true
},
files: {
'dist/angular-typescript.min.js': ['dist/angular-typescript.js']
}
}
}
}
);
grunt.registerTask(
'build',
'Compiles all of the assets and copies the files to the build directory.',
['clean', 'ts:build' ]
);
grunt.registerTask(
'test',
'Compiles each file and run tests',
['clean:folder1', 'ts:tests', 'jasmine:tests']
)
grunt.registerTask(
'release',
'Test, Build and Compress Files',
['test', 'build', 'string-replace:inline','uglify']
);
};