forked from lyaunzbe/ptolemy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
47,481 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# Changelog | ||
|
||
### v1.2.0 | ||
- Ported to work both on the client side as well as server side | ||
|
||
### v1.1.2 | ||
- Fix typo | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
'use strict'; | ||
|
||
const Gulp = require('gulp'); | ||
const Rename = require('gulp-rename'); | ||
const Source = require('vinyl-source-stream'); | ||
const Browserify = require('browserify'); | ||
const Derequire = require('gulp-derequire'); | ||
const Watchify = require('watchify'); | ||
const Babelify = require('babelify'); | ||
const Notify = require('gulp-notify'); | ||
|
||
|
||
function compile (watch) { | ||
let bundler = Browserify({ | ||
// Required watchify args | ||
cache: {}, packageCache: {}, | ||
// Specify the entry point of your app | ||
entries: ['./lib/ptolemy.js'], | ||
// Enable source maps! | ||
debug: true, | ||
// Allows this to be included from as bundled library | ||
standalone: 'window' | ||
}); | ||
|
||
bundler | ||
.transform(Babelify.configure({ | ||
presets: ['latest'] | ||
})) | ||
.transform('debowerify'); | ||
|
||
let bundle = function () { | ||
console.log('Bundling ->'); | ||
return bundler.bundle() | ||
.on('error', function() { | ||
let args = Array.prototype.slice.call(arguments); | ||
// Send error to notification center with gulp-notify | ||
Notify.onError({ | ||
title: 'Compile Error', | ||
message: '<%= error.message %>' | ||
}).apply(this, args); | ||
|
||
// Keep gulp from hanging on this task | ||
this.emit('end'); | ||
}) | ||
.pipe(Source('./index.js')) | ||
.pipe(Derequire()) | ||
.pipe(Rename('ptolemy.js')) | ||
.pipe(Gulp.dest('dist/')) | ||
}; | ||
|
||
if (watch) { | ||
bundler = Watchify(bundler) | ||
.on('update', bundle); | ||
|
||
return bundle(); | ||
} | ||
|
||
return bundle(); | ||
} | ||
|
||
function watch() { | ||
return compile(true); | ||
}; | ||
|
||
Gulp.task('build', function () { return compile(); }); | ||
Gulp.task('watch', function() { return watch(); }); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters