forked from marshell08/grafana-plugins
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Gruntfile.js
80 lines (70 loc) · 1.7 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
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-ts');
grunt.loadNpmTasks('grunt-tslint');
grunt.loadNpmTasks('grunt-karma');
grunt.initConfig({
clean: ["dist/*"],
ts: {
dist: {
src: ['src/**/*.ts'],
dest: 'dist/',
options: {
rootDir: "src/",
target: 'es5',
module: 'commonjs',
sourceMap: true,
emitDecoratorMetadata: true,
experimentalDecorators: true,
removeComments: false,
noImplicitAny: false,
moduleResolution: "node",
lib: ["dom", "es2015", "es5", "es6"],
typeRoots: ["node_modules/@types"],
}
},
},
tslint: {
source: { files: { src: ['src/**/*.ts'] }},
options: { configuration: 'tslint.json' }
},
copy: {
sources: {
cwd: 'src',
expand: true,
src: ['**/*.html', '**/*.js'],
dest: 'dist/'
},
staticContent: {
expand: true,
src: ['LICENSE', 'README.md', 'img/*', 'docs/*'],
dest: 'dist/'
},
plugin: {
src: [ 'plugin.json', 'README.md' ],
dest: 'dist/'
}
},
watch: {
rebuild_all: {
files: ['src/**/*', 'plugin.json'],
tasks: ['default'],
options: {spawn: false}
}
},
karma: {
test: {
configFile: 'karma.conf.js'
}
},
});
grunt.registerTask('default', [
'clean',
'tslint',
'copy:sources',
'copy:plugin',
'copy:staticContent',
'ts:dist',
'karma:test']);
};