-
Notifications
You must be signed in to change notification settings - Fork 9
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
Ren Yuan
committed
May 31, 2021
1 parent
eaf8819
commit a1f4e94
Showing
5 changed files
with
4,730 additions
and
2 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,2 +1,5 @@ | ||
# c2.js | ||
JavasScript library for creative coding | ||
# [c2.js](http://c2js.org) | ||
|
||
c2.js is a JavaScript library for creative coding based on computational geometry, physics simulation, evolutionary algorithm and other modules. | ||
|
||
[Get Started](http://c2js.org/get-started.html) · [Examples](http://c2js.org/examples.html) · [Reference](http://c2js.org/reference.html) |
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,29 @@ | ||
const gulp = require('gulp'); | ||
const browserify = require('browserify'); | ||
const tsify = require("tsify"); | ||
const source = require('vinyl-source-stream'); | ||
const uglify = require('gulp-uglify'); | ||
const rename = require('gulp-rename'); | ||
const {series} = require('gulp'); | ||
|
||
function build() { | ||
return browserify({entries: ['src/main.ts'], standalone: 'c2'}) | ||
.plugin(tsify) | ||
.bundle() | ||
.pipe(source('c2.js')) | ||
.pipe(gulp.dest("dist")); | ||
} | ||
|
||
function compress() { | ||
return gulp.src('dist/c2.js') | ||
.pipe(uglify()) | ||
.pipe(rename({extname: '.min.js'})) | ||
.pipe(gulp.dest('dist')); | ||
} | ||
|
||
function copy() { | ||
return gulp.src('dist/c2.min.js') | ||
.pipe(gulp.dest('website/assets')); | ||
} | ||
|
||
exports.default = series(build, compress, copy); |
Oops, something went wrong.