From a8a76651c2e3e59a9414c3a36dc81ecaf3053b04 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sat, 15 Oct 2016 12:20:01 -0400 Subject: [PATCH] Removing gulp JS build scripting --- gulpfile.js | 21 ++------------------- lib/canopy-transform.js | 24 ------------------------ package.json | 3 --- 3 files changed, 2 insertions(+), 46 deletions(-) delete mode 100644 lib/canopy-transform.js diff --git a/gulpfile.js b/gulpfile.js index 56a069e..af5f07e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,16 +9,13 @@ const gulp = require('gulp-help')(require('gulp')), rename = require('gulp-rename'), sass = require('gulp-sass'), bourbon = require('node-bourbon'), - browserify = require('browserify'), source = require('vinyl-source-stream'), buffer = require('vinyl-buffer'), sourcemaps = require('gulp-sourcemaps'), - canopy = require('./lib/canopy-transform'), babelify = require('babelify'), karma = require('karma'), path = require('path'), jscs = require('gulp-jscs'), - uglify = require('gulp-uglify'), config = require('./config'); gulp.task('default', 'Auto-rebuild site on changes.', ['server', 'docs'], function() { @@ -31,7 +28,7 @@ gulp.task('default', 'Auto-rebuild site on changes.', ['server', 'docs'], functi config.globs.svg_sass ]), ['markup']); gulp.watch(config.globs.sass, ['styles']); - gulp.watch(config.globs.js, ['scripts', 'docs']); + gulp.watch(config.globs.js, ['docs']); }); gulp.task('docs', 'Build documentation into ./docs directory.', ['docs:files'], function() { @@ -57,7 +54,7 @@ gulp.task('server', 'Start development server.', ['build'], function() { }); }); -gulp.task('build', 'Build site into ./build directory.', ['static', 'markup', 'styles', 'scripts']); +gulp.task('build', 'Build site into ./build directory.', ['static', 'markup', 'styles']); gulp.task('static', 'Build static files into ./build directory.', function() { return gulp.src(config.globs.other, { base: './src' }) @@ -112,20 +109,6 @@ gulp.task('styles', 'Build stylesheets into ./build directory.', function() { .pipe(gulp.dest(config.buildPath('css'))) }); -gulp.task('scripts', 'Build scripts into ./build directory', function() { - return browserify([require.resolve('babel-polyfill'), './src/js/main.js'], config.browserify) - .transform(canopy) - .transform(babelify) - .bundle() - .on('error', notify.onError()) - .pipe(source('main.js')) - .pipe(buffer()) - .pipe(sourcemaps.init({ loadMaps: true })) - .pipe(uglify()) - .pipe(sourcemaps.write('.')) - .pipe(gulp.dest(config.buildPath('js'))); -}); - gulp.task('verify', 'Verify (lint and run tests) scripts.', ['karma:single', 'lint']); gulp.task('verify:watch', 'Auto-verify scripts.', ['karma', 'lint:watch']); diff --git a/lib/canopy-transform.js b/lib/canopy-transform.js deleted file mode 100644 index 2fe7ef3..0000000 --- a/lib/canopy-transform.js +++ /dev/null @@ -1,24 +0,0 @@ -var through = require('through'), - canopy = require('canopy'); - -module.exports = function(file) { - var data = ''; - - if (!/\.peg$/.test(file)) { - return through(); - } - - return through( - function(buf) { - data += buf; - }, - function() { - try { - this.queue(String(canopy.compile(data))); - } catch(err) { - this.emit('error', err); - } - this.queue(null); - } - ); -}; diff --git a/package.json b/package.json index d5291a4..f793b05 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "babel-preset-es2015": "^6.16.0", "babel-runtime": "^6.3.19", "babelify": "^7.1.0", - "browserify": "^13.0.0", "canopy": "^0.2.0", "folder-toc": "^0.1.0", "gulp": "^3.8.10", @@ -30,7 +29,6 @@ "gulp-rename": "^1.2.2", "gulp-sass": "^2.1.1", "gulp-sourcemaps": "^1.6.0", - "gulp-uglify": "^1.4.2", "handlebars-layouts": "^3.1.2", "imports-loader": "^0.6.5", "jasmine-core": "^2.4.1", @@ -42,7 +40,6 @@ "lodash": "^4.6.1", "node-bourbon": "^4.2.3", "snapsvg": "^0.4.0", - "through": "^2.3.8", "vinyl-buffer": "^1.0.0", "vinyl-source-stream": "^1.1.0", "watchify": "^3.7.0",