BVB Source Codes

web-design-standards Show javascript.js Source code

Return Download web-design-standards: download javascript.js Source code - Download web-design-standards Source code - Type:.js
  1. var gulp = require('gulp');
  2. var gutil = require('gulp-util');
  3. var dutil = require('./doc-util');
  4. var browserify = require('browserify');
  5. var buffer = require('vinyl-buffer');
  6. var source = require('vinyl-source-stream');
  7. var uglify = require('gulp-uglify');
  8. var sourcemaps = require('gulp-sourcemaps');
  9. var merge = require('merge-stream');
  10. var rename = require('gulp-rename');
  11. var eslint = require('gulp-eslint');
  12. var task = 'javascript';
  13.  
  14. gulp.task('eslint', function (done) {
  15.  
  16.   if (!cFlags.test) {
  17.     dutil.logMessage('eslint', 'Skipping linting of JavaScript files.');
  18.     return done();
  19.   }
  20.  
  21.   return gulp.src([
  22.       'src/js/**/*.js',
  23.       '!src/js/vendor/**/*.js',
  24.       'spec/**/*.js'
  25.     ])
  26.     .pipe(eslint())
  27.     .pipe(eslint.format());
  28.  
  29. });
  30.  
  31. gulp.task(task, [ 'eslint' ], function (done) {
  32.  
  33.   dutil.logMessage(task, 'Compiling JavaScript');
  34.  
  35.   var defaultStream = browserify({
  36.     entries: 'src/js/start.js',
  37.     debug: true,
  38.   });
  39.  
  40.   defaultStream = defaultStream.bundle()
  41.     .pipe(source('components.js'))
  42.     .pipe(buffer())
  43.     .pipe(rename({ basename: dutil.pkg.name }))
  44.     .pipe(gulp.dest('dist/js'));
  45.  
  46.   var minifiedStream = browserify({
  47.     entries: 'src/js/start.js',
  48.     debug: true,
  49.   });
  50.  
  51.   minifiedStream = minifiedStream.bundle()
  52.     .pipe(source('components.js'))
  53.     .pipe(buffer())
  54.     .pipe(sourcemaps.init({ loadMaps: true }))
  55.       .pipe(uglify())
  56.       .on('error', gutil.log)
  57.       .pipe(rename({
  58.         basename: dutil.pkg.name,
  59.         suffix: '.min',
  60.       }))
  61.     .pipe(sourcemaps.write('.'))
  62.     .pipe(gulp.dest('dist/js'));
  63.  
  64.   return merge(defaultStream, minifiedStream);
  65.  
  66. });
  67.  
downloadjavascript.js Source code - Download web-design-standards Source code
Related Source Codes/Software:
KineticJS - KineticJS is an HTML5 Canvas JavaScript framework ... 2017-01-07
yui3 - A library for building richly interactive web appl... 2017-01-07
TextBlob - Simple, Pythonic, text processing--Sentiment analy... 2017-01-07
monaco-editor - A browser based code editor 2017-01-07
grumpy - Grumpy is a Python to Go source code transcompiler... 2017-01-07
Knuff - The debug application for Apple Push Notification ... 2017-01-07
RoundedImageView - A fast ImageView that supports rounded corners, ov... 2017-01-07
flowchart.js - Draws simple SVG flow chart diagrams from textual ... 2017-01-08
TextFieldEffects - Custom UITextFields effects inspired by Codrops, b... 2017-01-08
glide - Package Management for Golang h... 2017-01-08
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top