mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 09:26:43 -06:00
55 lines
1.1 KiB
JavaScript
55 lines
1.1 KiB
JavaScript
module.exports = function(grunt) {
|
|
|
|
require('load-grunt-tasks')(grunt);
|
|
|
|
grunt.loadNpmTasks('grunt-execute');
|
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
|
|
grunt.initConfig({
|
|
|
|
clean: ["dist"],
|
|
|
|
copy: {
|
|
src_to_dist: {
|
|
cwd: 'src',
|
|
expand: true,
|
|
src: ['**/*', '!**/*.js', '!**/*.scss'],
|
|
dest: 'dist'
|
|
},
|
|
pluginDef: {
|
|
expand: true,
|
|
src: 'plugin.json',
|
|
dest: 'dist',
|
|
}
|
|
},
|
|
|
|
watch: {
|
|
rebuild_all: {
|
|
files: ['src/**/*', 'plugin.json'],
|
|
tasks: ['default'],
|
|
options: {spawn: false}
|
|
},
|
|
},
|
|
|
|
babel: {
|
|
options: {
|
|
sourceMap: true,
|
|
presets: ["es2015"],
|
|
plugins: ['transform-es2015-modules-systemjs', "transform-es2015-for-of"],
|
|
},
|
|
dist: {
|
|
files: [{
|
|
cwd: 'src',
|
|
expand: true,
|
|
src: ['**/*.js'],
|
|
dest: 'dist',
|
|
ext:'.js'
|
|
}]
|
|
},
|
|
},
|
|
|
|
});
|
|
|
|
grunt.registerTask('default', ['clean', 'copy:src_to_dist', 'copy:pluginDef', 'babel']);
|
|
};
|