Skip to content

Commit 29cc0b5

Browse files
babel is here
1 parent e05b056 commit 29cc0b5

4 files changed

Lines changed: 9 additions & 2 deletions

File tree

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["env"]
3+
}

gulpfile.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,22 @@ const source = require('vinyl-source-stream');
1111
const buffer = require('vinyl-buffer');
1212
const pkg = require('./package.json');
1313
const jsprettify = require('gulp-jsbeautifier');
14+
const babel = require("gulp-babel");
1415

1516
/// Build the scripts
1617
gulp.task('build', function() {
1718
browserify('./src/index.js')
1819
.bundle()
1920
.pipe(source('gpu.js'))
2021
.pipe(buffer())
22+
.pipe(babel())
2123
.pipe(header(fs.readFileSync('./src/wrapper/prefix.js', 'utf8'), { pkg : pkg }))
2224
.pipe(gulp.dest('bin'));
2325
});
2426

2527
/// Minify the build script, after building it
2628
gulp.task('minify', ['build'], function() {
27-
return gulp.src(['bin/gpu.js'])
29+
return gulp.src(['./bin/gpu.js'])
2830
.pipe(rename('gpu.min.js'))
2931
.pipe(
3032
uglify({

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
},
1010
"devDependencies": {
1111
"babel-plugin-syntax-async-functions": "^6.5.0",
12+
"babel-preset-env": "^1.5.2",
1213
"browser-sync": "^2.18.2",
1314
"browserify": "^14.3.0",
1415
"gulp": "^3.9.1",
16+
"gulp-babel": "^6.1.2",
1517
"gulp-concat": "^2.6.0",
1618
"gulp-header": "^1.7.1",
1719
"gulp-jsbeautifier": "^2.1.0",

src/wrapper/prefix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
* The MIT License
1212
*
1313
* Copyright (c) <%= new Date().getFullYear() %> gpu.js Team
14-
*/
14+
*/

0 commit comments

Comments
 (0)