Removing gulp JS build scripting
This commit is contained in:
parent
c55adb13d9
commit
a8a76651c2
21
gulpfile.js
21
gulpfile.js
@ -9,16 +9,13 @@ const gulp = require('gulp-help')(require('gulp')),
|
|||||||
rename = require('gulp-rename'),
|
rename = require('gulp-rename'),
|
||||||
sass = require('gulp-sass'),
|
sass = require('gulp-sass'),
|
||||||
bourbon = require('node-bourbon'),
|
bourbon = require('node-bourbon'),
|
||||||
browserify = require('browserify'),
|
|
||||||
source = require('vinyl-source-stream'),
|
source = require('vinyl-source-stream'),
|
||||||
buffer = require('vinyl-buffer'),
|
buffer = require('vinyl-buffer'),
|
||||||
sourcemaps = require('gulp-sourcemaps'),
|
sourcemaps = require('gulp-sourcemaps'),
|
||||||
canopy = require('./lib/canopy-transform'),
|
|
||||||
babelify = require('babelify'),
|
babelify = require('babelify'),
|
||||||
karma = require('karma'),
|
karma = require('karma'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
jscs = require('gulp-jscs'),
|
jscs = require('gulp-jscs'),
|
||||||
uglify = require('gulp-uglify'),
|
|
||||||
config = require('./config');
|
config = require('./config');
|
||||||
|
|
||||||
gulp.task('default', 'Auto-rebuild site on changes.', ['server', 'docs'], function() {
|
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
|
config.globs.svg_sass
|
||||||
]), ['markup']);
|
]), ['markup']);
|
||||||
gulp.watch(config.globs.sass, ['styles']);
|
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() {
|
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() {
|
gulp.task('static', 'Build static files into ./build directory.', function() {
|
||||||
return gulp.src(config.globs.other, { base: './src' })
|
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')))
|
.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', 'Verify (lint and run tests) scripts.', ['karma:single', 'lint']);
|
||||||
|
|
||||||
gulp.task('verify:watch', 'Auto-verify scripts.', ['karma', 'lint:watch']);
|
gulp.task('verify:watch', 'Auto-verify scripts.', ['karma', 'lint:watch']);
|
||||||
|
@ -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);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
@ -16,7 +16,6 @@
|
|||||||
"babel-preset-es2015": "^6.16.0",
|
"babel-preset-es2015": "^6.16.0",
|
||||||
"babel-runtime": "^6.3.19",
|
"babel-runtime": "^6.3.19",
|
||||||
"babelify": "^7.1.0",
|
"babelify": "^7.1.0",
|
||||||
"browserify": "^13.0.0",
|
|
||||||
"canopy": "^0.2.0",
|
"canopy": "^0.2.0",
|
||||||
"folder-toc": "^0.1.0",
|
"folder-toc": "^0.1.0",
|
||||||
"gulp": "^3.8.10",
|
"gulp": "^3.8.10",
|
||||||
@ -30,7 +29,6 @@
|
|||||||
"gulp-rename": "^1.2.2",
|
"gulp-rename": "^1.2.2",
|
||||||
"gulp-sass": "^2.1.1",
|
"gulp-sass": "^2.1.1",
|
||||||
"gulp-sourcemaps": "^1.6.0",
|
"gulp-sourcemaps": "^1.6.0",
|
||||||
"gulp-uglify": "^1.4.2",
|
|
||||||
"handlebars-layouts": "^3.1.2",
|
"handlebars-layouts": "^3.1.2",
|
||||||
"imports-loader": "^0.6.5",
|
"imports-loader": "^0.6.5",
|
||||||
"jasmine-core": "^2.4.1",
|
"jasmine-core": "^2.4.1",
|
||||||
@ -42,7 +40,6 @@
|
|||||||
"lodash": "^4.6.1",
|
"lodash": "^4.6.1",
|
||||||
"node-bourbon": "^4.2.3",
|
"node-bourbon": "^4.2.3",
|
||||||
"snapsvg": "^0.4.0",
|
"snapsvg": "^0.4.0",
|
||||||
"through": "^2.3.8",
|
|
||||||
"vinyl-buffer": "^1.0.0",
|
"vinyl-buffer": "^1.0.0",
|
||||||
"vinyl-source-stream": "^1.1.0",
|
"vinyl-source-stream": "^1.1.0",
|
||||||
"watchify": "^3.7.0",
|
"watchify": "^3.7.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user