This commit is contained in:
Max Lynch 2015-11-24 19:29:19 -06:00
parent 6463f2f510
commit 0df97597a5
2 changed files with 0 additions and 71 deletions

View File

@ -1,58 +0,0 @@
var gulp = require("gulp"),
source = require('vinyl-source-stream'),
buffer = require('vinyl-buffer'),
sourcemaps = require("gulp-sourcemaps"),
concat = require("gulp-concat"),
connect = require('gulp-connect'),
browserify = require('browserify'),
watchify = require('watchify'),
babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify()
.require('./src/index.js', {
entry: true,
expose: 'cordova-wrap'
})
.transform(babel, {presets: ['es2015']}));
function rebundle() {
bundler.bundle()
.on('error', function(err) { console.error(err); this.emit('end'); })
.pipe(source('cordova-wrap.js'))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dist'));
}
if (watch) {
bundler.on('update', function() {
console.log('-> bundling...');
rebundle();
});
}
rebundle();
}
function watch() {
return compile(true);
}
gulp.task("default", ['build'], function () { });
gulp.task('build', function() {
return compile();
});
gulp.task('watch', function() {
return watch();
});
gulp.task('serve', function() {
connect.server({
root: '.'
});
});

13
test.js
View File

@ -1,13 +0,0 @@
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"/src/index.js":[function(require,module,exports){
class Native {
}
console.log('Doing a thing');
export default Native;
},{}]},{},["/src/index.js"]);