Files
grafana-statusmap/Gruntfile.js
T
2019-03-22 17:55:18 +03:00

78 lines
1.7 KiB
JavaScript

module.exports = (grunt) => {
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-execute');
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', '!**/*.scss'],
dest: 'dist'
},
pluginDef: {
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: ['es2015'],
plugins: ['transform-es2015-modules-systemjs', 'transform-es2015-for-of', 'transform-class-properties', 'transform-object-rest-spread'],
},
dist: {
files: [{
cwd: 'src',
expand: true,
src: ['*.js', '**/*.js'],
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:pluginDef', 'babel', 'sass']);
// grunt.registerTask('clean', ['clean']);
// grunt.registerTask('watch', ['watch']);
};