source: js/human_3d_alignment/gulpfile.js @ 1324

Last change on this file since 1324 was 881, checked in by Maciej Komosinski, 6 years ago

Initial, prototype version of a javascript app to test how humans align two 3D structures

File size: 1.5 KB
Line 
1var gulp = require('gulp');
2var browserify = require('browserify');
3var eslint = require('gulp-eslint');
4var babelify = require('babelify');
5var source = require('vinyl-source-stream');
6var buffer = require('vinyl-buffer');
7var browserSync = require('browser-sync').create();
8var sourcemaps = require('gulp-sourcemaps');
9var jsdoc = require('gulp-jsdoc3');
10
11gulp.task('eslint', function() {
12    return gulp.src(['src/**/*.jsx','src/**/*.js', 'src/*.jsx'])
13        .pipe(eslint())
14        .pipe(eslint.format())
15        .pipe(eslint.failOnError());
16});
17
18gulp.task('build', function () {
19    return browserify({entries: './src/app.jsx', extensions: ['.jsx'], debug: true})
20        .ignore('./sdk-core/frams_sdk.js', './external/physijs/*')
21        .transform(babelify, {presets: ['es2015', 'react']})
22        .bundle()
23        .pipe(source('bundle.js'))
24        .pipe(buffer())
25        .pipe(sourcemaps.init({loadMaps: true}))
26        .pipe(sourcemaps.write('.', {
27            includeContent: true,
28            sourceRoot: '.'
29        }))
30        .pipe(gulp.dest('dist'));
31});
32
33gulp.task('watch', ['eslint', 'build'], function () {
34    gulp.watch(['src/**/*.jsx','src/**/*.js'], ['build']);
35});
36
37gulp.task('browser-sync', function() {
38    browserSync.init({
39        server: {
40            baseDir: "./"
41        }
42    });
43    gulp.watch("dist/*").on('change',browserSync.reload);
44});
45
46gulp.task('doc', function(cb) {
47    gulp.src(['DOCUMENTATION.md', './src/**/*.jsx', './src/**/*.js'], {read: false})
48        .pipe(jsdoc(cb));
49});
50
51gulp.task('default', ['eslint', 'build']);
Note: See TracBrowser for help on using the repository browser.