mirror of
https://github.com/bvanroll/rpiRadio.git
synced 2025-08-30 12:32:47 +00:00
36 lines
1.0 KiB
JavaScript
36 lines
1.0 KiB
JavaScript
const config = require('../config');
|
|
|
|
const gulp = require('gulp');
|
|
const browserify = require('browserify');
|
|
const babelify = require('babelify');
|
|
const source = require('vinyl-source-stream');
|
|
const buffer = require('vinyl-buffer');
|
|
const uglify = require('gulp-uglify');
|
|
const sourcemaps = require('gulp-sourcemaps');
|
|
const gutil = require('gulp-util');
|
|
|
|
gulp.task('browserify', function () {
|
|
// set up the browserify instance on a task basis
|
|
let b = browserify({
|
|
entries: config.paths.entry,
|
|
debug: true,
|
|
standalone: config.names.glob,
|
|
transform: [
|
|
babelify.configure({
|
|
presets: ['es2015'],
|
|
sourceMapsAbsolute: true,
|
|
}),
|
|
],
|
|
});
|
|
|
|
return b.bundle()
|
|
.pipe(source(config.names.app))
|
|
.pipe(buffer())
|
|
.pipe(sourcemaps.init({loadMaps: true}))
|
|
// Add transformation tasks to the pipeline here.
|
|
.pipe(uglify())
|
|
.on('error', gutil.log)
|
|
.pipe(sourcemaps.write('./'))
|
|
.pipe(gulp.dest(config.paths.dest));
|
|
});
|