Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Ren Yuan committed May 31, 2021
1 parent eaf8819 commit a1f4e94
Show file tree
Hide file tree
Showing 5 changed files with 4,730 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
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)
29 changes: 29 additions & 0 deletions gulpfile.js
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);
Loading

0 comments on commit a1f4e94

Please sign in to comment.