forked from flant/grafana-statusmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
86 lines (77 loc) · 1.99 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
'use strict';
module.exports = (grunt) => {
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-notify');
grunt.initConfig({
notify: {
watch: {
options: {
message: 'grunt watch Complete',
title: 'flant-statusmap-panel rebuilded',
duration: 2
}
}
},
clean: ['dist'],
copy: {
src_to_dist: {
cwd: 'src',
expand: true,
src: ['**/*', '!**/*.js', '!**/*.ts', '!**/*.scss'],
dest: 'dist'
},
root_to_dist: {
expand: true,
src: ['plugin.json', 'README.md', 'CHANGELOG.md'],
dest: 'dist'
}
},
watch: {
rebuild_all: {
files: ['src/**/*', 'plugin.json'],
tasks: ['default', 'notify:watch'],
options: {
spawn: false,
livereload: true
}
}
},
babel: {
options: {
sourceMap: true,
presets: ['@babel/preset-env', '@babel/typescript'],
plugins: ['angularjs-annotate', '@babel/plugin-transform-modules-systemjs', '@babel/plugin-transform-for-of', '@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-object-rest-spread'],
},
d3lib: {
files: [{
cwd: 'src',
expand: true,
src: ['libs/**/*.js'],
dest: 'dist',
ext: '.js'
}]
},
dist: {
files: [{
cwd: 'src',
expand: true,
src: ['*.ts', '**/*.ts'],
dest: 'dist',
ext: '.js'
}]
}
},
sass: {
dist: {
files: {
'dist/css/statusmap.dark.css': 'src/css/statusmap.dark.scss',
'dist/css/statusmap.light.css': 'src/css/statusmap.light.scss'
}
}
}
});
grunt.registerTask('default', ['clean', 'copy:src_to_dist', 'copy:root_to_dist', 'babel', 'sass']);
// grunt.registerTask('clean', ['clean']);
// grunt.registerTask('watch', ['watch']);
};