Initial ES6 migration. module.js and datasource.js are migrated to ES6.

This commit is contained in:
Alexander Zobnin
2016-03-14 23:42:24 +03:00
parent 50c0764d01
commit 8b37478131
31 changed files with 567 additions and 455 deletions

62
Gruntfile.js Normal file
View File

@@ -0,0 +1,62 @@
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: [
'**/*',
'!**/datasource.js',
'!**/module.js',
'!**/*.scss'
],
dest: 'dist/src'
},
pluginDef: {
expand: true,
src: ['plugin.json', 'README.md'],
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: [
'**/**/datasource.js',
'**/**/module.js',
],
dest: 'dist/src',
ext:'.js'
}]
},
},
});
grunt.registerTask('default', ['clean', 'copy:src_to_dist', 'copy:pluginDef', 'babel']);
};