mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-04 00:13:06 +08:00
Shtuff
This commit is contained in:
parent
6463f2f510
commit
0df97597a5
58
gulpfile.js
58
gulpfile.js
@ -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
13
test.js
@ -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"]);
|
|
Loading…
Reference in New Issue
Block a user