mirror of
https://gitlab.silvrtree.co.uk/martind2000/temptest.git
synced 2025-01-11 06:15:08 +00:00
30 lines
919 B
JavaScript
30 lines
919 B
JavaScript
'use strict';
|
|
const gulp = require('gulp');
|
|
const browserify = require('gulp-browserify');
|
|
const rename = require('gulp-rename');
|
|
|
|
const buffer = require('vinyl-buffer');
|
|
const sourcemaps = require('gulp-sourcemaps');
|
|
|
|
gulp.task('bundleBackbone', function() {
|
|
// Single entry point to browserify
|
|
gulp.src(['./src/backbone/js/app.js'])
|
|
.pipe(browserify({
|
|
'insertGlobals' : true,
|
|
'debug' : true
|
|
}))
|
|
.pipe(buffer())
|
|
// optional, remove if you dont want sourcemaps
|
|
.pipe(sourcemaps.init({ 'loadMaps': true })) // loads map from browserify file
|
|
// Add transformation tasks to the pipeline here.
|
|
.pipe(sourcemaps.write('./src/backbone/')) // writes .map file
|
|
.pipe(rename('bundle.js'))
|
|
// .pipe(uglify())
|
|
.pipe(gulp.dest('./src/backbone/'));
|
|
});
|
|
|
|
gulp.task('buildBackbone', ['bundleBackbone'], function() {
|
|
gulp.watch('src/backbone/js/**/*.js', ['bundleBackbone']);
|
|
});
|
|
|