Skip to content

Commit

Permalink
using gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
bluejoe2008 committed Feb 22, 2018
1 parent ca9d15e commit 55a00a6
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dist/igbrowser.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/igbrowser.min.js.map

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions graphviz.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="graphviz node_modules" level="project" />
</component>
</module>
27 changes: 27 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';

var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var gutil = require('gulp-util');

gulp.task('default', function() {
var b = browserify({
entries: './src/browser.js',
standalone: 'igraph',
debug: true
});

return b.bundle()
.pipe(source('./igbrowser.min.js'))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true}))
// 在这里将转换任务加入管道
.pipe(uglify())
.on('error', gutil.log)
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dist/'));
});
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "interactive-graph-browser",
"version": "0.0.1",
"scripts": {
"build": "gulp"
},
"dependencies": {
"browserify": "^16.1.0",
"canvas": "^1.6.9",
"events": "^2.0.0",
"gulp": "^3.9.1",
"gulp-browserify": "^0.5.1",
"gulp-sourcemaps": "^2.6.4",
"gulp-uglify": "^3.0.0",
"gulp-util": "^3.0.8",
"jquery": "^3.3.1",
"jsdom": "^11.6.2",
"jsdom-global": "^3.0.2",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0",
"vis": "^4.21.0"
},
"devDependencies": {}
}

0 comments on commit 55a00a6

Please sign in to comment.