Commit da113560047668c2d36c4b998583580f9b315768

Authored by Richard Gaunt
1 parent bd8c6891aa
Exists in master

code clean up, removed unused variables and shortened lines

Showing 2 changed files with 4 additions and 3 deletions   Show diff stats
1 // Include gulp 1 // Include gulp
2 var argv = require('yargs').argv; 2 var argv = require('yargs').argv;
3 3
4 var gulp = require('gulp'); 4 var gulp = require('gulp');
5 5
6 // Include Our Plugins 6 // Include Our Plugins
7 var jshint = require('gulp-jshint'); 7 var jshint = require('gulp-jshint');
8 var sass = require('gulp-ruby-sass'); 8 var sass = require('./gulp-ruby-sass/');
9 var concat = require('gulp-concat'); 9 var concat = require('gulp-concat');
10 var uglify = require('gulp-uglify'); 10 var uglify = require('gulp-uglify');
11 var rename = require('gulp-rename'); 11 var rename = require('gulp-rename');
12 var autoprefixer = require('gulp-autoprefixer'); 12 var autoprefixer = require('gulp-autoprefixer');
13 13
14 var browserSync = require('browser-sync'); 14 var browserSync = require('browser-sync');
15 var reload = browserSync.reload; 15 var reload = browserSync.reload;
16 16
17 //Parse a few options from command line 17 //Parse a few options from command line
18 var proxy = argv.u; 18 var proxy = argv.u;
19 console.log(argv); 19 console.log(argv);
20 console.log(typeof argv); 20 console.log(typeof argv);
21 console.log('argv.url', argv.url); 21 console.log('argv.url', argv.url);
22 22
23 //Start local server 23 //Start local server
24 24
25 // gulp.task('browser-sync', function() { 25 // gulp.task('browser-sync', function() {
26 // browserSync({ 26 // browserSync({
27 // proxy: (argv.url !== undefined) ? argv.url : 'localhost' 27 // proxy: (argv.url !== undefined) ? argv.url : 'localhost'
28 // }); 28 // });
29 // }); 29 // });
30 30
31 31
32 // // Lint Task 32 // // Lint Task
33 // gulp.task('lint', function() { 33 // gulp.task('lint', function() {
34 // return gulp.src('js/*.js') 34 // return gulp.src('js/*.js')
35 // .pipe(jshint()) 35 // .pipe(jshint())
36 // .pipe(jshint.reporter('default')); 36 // .pipe(jshint.reporter('default'));
37 // }); 37 // });
38 38
39 // Compile Our Sass 39 // Compile Our Sass
40 gulp.task('sass', function() { 40 gulp.task('sass', function() {
41 return gulp.src('../themes/alfrescobase/scss/*.scss') 41 return gulp.src('../themes/alfrescobase/scss/*.scss')
42 //issue getting sourcemap to link correctly from browser however lines are showing up correctly 42 //issue getting sourcemap to link correctly from browser however lines are showing up correctly
43 .pipe(sass({sourcemap: true, sourcemapPath: 'themes/alfrescobase/scss', style: 'compact'})) 43 .pipe(sass({sourcemap: true, sourcemapPath: '../../../../scss', style: 'compact'}))
44 .pipe(autoprefixer("last 1 version", "> 1%", "ie 8", "ie 7")) 44 .pipe(autoprefixer("last 1 version", "> 1%", "ie 8", "ie 7"))
45 .pipe(gulp.dest('../themes/alfrescobase/css')); 45 .pipe(gulp.dest('../themes/alfrescobase/test/test/test/css'));
46 // .pipe(reload({stream:true})); 46 // .pipe(reload({stream:true}));
47 }); 47 });
48 48
49 // // Concatenate & Minify JS 49 // // Concatenate & Minify JS
50 // gulp.task('scripts', function() { 50 // gulp.task('scripts', function() {
51 // return gulp.src('../themes/alfrescobase/js/*.js') 51 // return gulp.src('../themes/alfrescobase/js/*.js')
52 // .pipe(concat('all.js')) 52 // .pipe(concat('all.js'))
53 // .pipe(gulp.dest('../themes/alfrescobase/dist')) 53 // .pipe(gulp.dest('../themes/alfrescobase/dist'))
54 // .pipe(rename('all.min.js')) 54 // .pipe(rename('all.min.js'))
55 // .pipe(uglify()) 55 // .pipe(uglify())
56 // .pipe(gulp.dest('dist')); 56 // .pipe(gulp.dest('dist'));
57 // }); 57 // });
58 58
59 59
60 // Watch Files For Changes 60 // Watch Files For Changes
61 gulp.task('watch', function() { 61 gulp.task('watch', function() {
62 // gulp.watch('../themes/alfrescobase/js/*.js', ['lint', 'scripts']); 62 // gulp.watch('../themes/alfrescobase/js/*.js', ['lint', 'scripts']);
63 gulp.watch('../themes/alfrescobase/scss/**/*.scss', ['sass']); 63 gulp.watch('../themes/alfrescobase/scss/**/*.scss', ['sass']);
64 }); 64 });
65 65
66 gulp.task('default', [/*'lint',*/ 'sass', /*'scripts',*/ 'watch', /*'browser-sync'*/]); 66 gulp.task('default', [/*'lint',*/ 'sass', /*'scripts',*/ 'watch', /*'browser-sync'*/]);
67 67