Skip to content

Commit

Permalink
Use grunt-babel with babel-polyfill for ES6 transpilation (RocketMap#…
Browse files Browse the repository at this point in the history
…1675)

* Use grunt-babel with babel-polyfill for ES6 transpilation

* Use grunt-babel with babel-polyfill for ES6 transpilation

* Moved static/js/map.js back to static/map.js and fixed newly added undeclared variable references in map.js
  • Loading branch information
ravishivt authored and 6iz committed Jul 27, 2016
1 parent f6dbab4 commit 6b48658
Show file tree
Hide file tree
Showing 6 changed files with 1,089 additions and 11 deletions.
19 changes: 16 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,25 @@ module.exports = function(grunt) {
}
}
},
babel: {
options: {
sourceMap: true,
presets: ['es2015']
},
dist: {
files: {
'static/dist/js/app.js': 'static/js/app.js',
'static/dist/js/map.js': 'static/map.js'
}
}
},
uglify: {
options: {
banner: '/*\n <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> \n*/\n'
},
build: {
files: {
'static/dist/js/app.min.js': 'static/js/app.js'
'static/dist/js/app.min.js': 'static/dist/js/app.js'
}
}
},
Expand All @@ -44,7 +56,7 @@ module.exports = function(grunt) {
js: {
files: ['**/*.js', '!node_modules/**/*.js', '!static/dist/**/*.js'],
options: { livereload: true },
tasks: ['uglify']
tasks: ['babel', 'uglify']
},
css: {
files: '**/*.scss',
Expand Down Expand Up @@ -77,7 +89,8 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-usemin');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-html-validation');
grunt.loadNpmTasks('grunt-babel');

grunt.registerTask('default', ['jshint', 'sass', 'cssmin', 'uglify', 'watch']);
grunt.registerTask('default', ['jshint', 'sass', 'cssmin', 'babel', 'uglify', 'watch']);

};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"description": "Pokemon Go Map - Live Visualization",
"main": "Gruntfile.js",
"devDependencies": {
"babel-preset-es2015": "^6.9.0",
"grunt": "^0.4.5",
"grunt-babel": "^6.0.0",
"grunt-contrib-clean": "latest",
"grunt-contrib-concat": "latest",
"grunt-contrib-connect": "latest",
Expand Down
4 changes: 2 additions & 2 deletions static/dist/js/app.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6b48658

Please sign in to comment.