From 099297ebdf33c5710c18ea5f10eeaa7eedf53c6a Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Fri, 13 Nov 2015 16:09:40 +0100 Subject: [PATCH] working on build process --- dist | 2 +- gulpfile.helper.js | 13 +++++++------ gulpfile.js | 2 +- package.json | 5 ++++- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/dist b/dist index acfce069..dcf62124 160000 --- a/dist +++ b/dist @@ -1 +1 @@ -Subproject commit acfce069121920c349b2678b2e1b6d0f1a62b45b +Subproject commit dcf62124363cabd3665a2487b8cf18b23c655ba3 diff --git a/gulpfile.helper.js b/gulpfile.helper.js index 49f9bd34..4fd9e499 100644 --- a/gulpfile.helper.js +++ b/gulpfile.helper.js @@ -28,14 +28,14 @@ module.exports = function (gulp, helperOptions) { } var babelOptions = { - loose: 'all', - modules: 'ignore', - experimental: true + presets: ['es2015'], + plugins: ['transform-runtime'] } if (!options.regenerator) { babelOptions.blacklist = 'regenerator' } else { - files.dist = [files.dist].concat(helperOptions.polyfills) + helperOptions.polyfills.push(files.dist) + files.dist = helperOptions.polyfills } gulp.task('dist', function () { @@ -46,11 +46,12 @@ module.exports = function (gulp, helperOptions) { gulp.src(['./README.md']) .pipe($.watch('./README.md')) .pipe(gulp.dest('./dist/')) - + console.log(JSON.stringify(files.dist)) return browserify({ entries: files.dist, debug: options.debug - }).bundle() + }).transform("babelify", {presets: ["es2015"], plugins: ['transform-runtime']}) + .bundle() .pipe(source(options.targetName)) .pipe(buffer()) .pipe($.if(options.debug, $.sourcemaps.init({loadMaps: true}))) diff --git a/gulpfile.js b/gulpfile.js index 6c539c71..8fcf38bb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -48,7 +48,7 @@ var $ = require('gulp-load-plugins')() var runSequence = require('run-sequence').use(gulp) require('./gulpfile.helper.js')(gulp, { - polyfills: ['node_modules/gulp-babel/node_modules/babel-core/node_modules/regenerator/runtime.js'], + polyfills: [], entry: './src/y.js', targetName: 'y.js', moduleName: 'yjs', diff --git a/package.json b/package.json index 36c86870..bf05472b 100644 --- a/package.json +++ b/package.json @@ -42,9 +42,12 @@ "homepage": "http://y-js.org", "devDependencies": { "babel-eslint": "^4.1.2", + "babel-plugin-transform-runtime": "^6.1.18", + "babel-preset-es2015": "^6.1.18", + "babelify": "^7.2.0", "browserify": "^12.0.1", "gulp": "^3.9.0", - "gulp-babel": "^5.2.1", + "gulp-babel": "^6.1.0", "gulp-bump": "^1.0.0", "gulp-concat": "^2.6.0", "gulp-filter": "^3.0.1",