diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 9fe1be2..0000000 --- a/.jshintrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "node": true, - "esnext": true, - "bitwise": true, - "curly": true, - "immed": true, - "newcap": true, - "noarg": true, - "undef": true, - "unused": "vars", - "strict": true -} diff --git a/package.json b/package.json index 1b01078..11f508c 100644 --- a/package.json +++ b/package.json @@ -1,25 +1,29 @@ { "name": "grunt-babel", "version": "5.0.3", - "description": "Turn ES6 code into vanilla ES5 with no runtime required", + "description": "Use next generation JavaScript, today", "license": "MIT", "repository": "babel/grunt-babel", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" + "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { - "test": "grunt" + "test": "xo && grunt" }, "files": [ "tasks" ], "keywords": [ "gruntplugin", + "babel", + "transpiler", + "es2015", + "es6", "rewriting", "transformation", "syntax", @@ -27,23 +31,22 @@ "desugaring", "javascript", "ecmascript", - "language", - "es5", - "es6", - "ES.next", - "harmony", - "compiler", - "transpiler", - "babel" + "compiler" ], "dependencies": { - "babel-core": "^6.0.2" + "babel-core": "^6.0.12" }, "devDependencies": { "babel-preset-es2015": "^6.0.11", "grunt": "^0.4.5", "grunt-cli": "^0.1.13", "grunt-contrib-clean": "^0.6.0", - "grunt-contrib-nodeunit": "^0.4.1" + "grunt-contrib-nodeunit": "^0.4.1", + "xo": "*" + }, + "xo": { + "ignores": [ + "test/fixture.js" + ] } } diff --git a/readme.md b/readme.md index 4added6..b6d2fbc 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,8 @@ # grunt-babel [![Build Status](https://travis-ci.org/babel/grunt-babel.svg?branch=master)](https://travis-ci.org/babel/grunt-babel) -> Turn ES6 code into vanilla ES5 with no runtime required using [babel](https://github.com/babel/babel) +> Use next generation JavaScript, today, with [Babel](https://babeljs.io) -*Issues with the output should be reported on the babel [issue tracker](https://github.com/babel/babel/issues).* +*Issues with the output should be reported on the Babel [issue tracker](https://github.com/babel/babel/issues).* ## Install @@ -37,7 +37,7 @@ grunt.registerTask('default', ['babel']); ## Options -See the `babel` [options](https://babeljs.io/docs/usage/options), except for `filename` which is handled for you. +See the Babel [options](https://babeljs.io/docs/usage/options), except for `filename` which is handled for you. ## License diff --git a/tasks/babel.js b/tasks/babel.js index c15d860..cf3ff6d 100644 --- a/tasks/babel.js +++ b/tasks/babel.js @@ -3,7 +3,7 @@ var path = require('path'); var babel = require('babel-core'); module.exports = function (grunt) { - grunt.registerMultiTask('babel', 'Transpile ES6 to ES5', function () { + grunt.registerMultiTask('babel', 'Use next generation JavaScript, today', function () { var options = this.options(); this.files.forEach(function (el) { @@ -11,14 +11,16 @@ module.exports = function (grunt) { delete options.filenameRelative; options.sourceFileName = path.relative(path.dirname(el.dest), el.src[0]); + if (process.platform === 'win32') { options.sourceFileName = options.sourceFileName.replace(/\\/g, '/'); } + options.sourceMapTarget = path.basename(el.dest); var res = babel.transformFileSync(el.src[0], options); - var sourceMappingURL = ''; + if (res.map) { sourceMappingURL = '\n//# sourceMappingURL=' + path.basename(el.dest) + '.map'; }