0

I was working on a new project at home last week and now I am in the office I am having no luck with Gulp.

There are no errors when I run Gulp but it isn't creating any files, I tried using Gulp-tap to see if anything was getting piped but its not. I am sure I am in the correct cwd and the file exists, but I have no luck. The task is also been run, confirmed by console.log'ing.

C:\Users\Jonathan\Documents\GitHub\ITMS-Backend>gulp
[11:02:16] Using gulpfile ~\Documents\GitHub\ITMS-Backend\Gulpfile.js
[11:02:16] Starting 'lint'...
[11:02:16] Starting 'sass'...
[11:02:16] Starting 'global-scripts'...
[11:02:16] Starting 'polymer'...
[11:02:16] Finished 'polymer' after 4.4 ms
[11:02:16] Finished 'lint' after 23 ms
[11:02:16] Finished 'global-scripts' after 14 ms
[11:02:16] Finished 'sass' after 19 ms
[11:02:16] Starting 'default'...
[11:02:16] Finished 'default' after 4.53 µs

My Gulp file as of current

var bower_root = 'public/components/'
    webcomponents_dir = 'public/webcomponents';

var gulp = require('gulp');
var fs = require('fs');


// Include Our Plugins
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var vulcanize = require('gulp-vulcanize');

var polymer_modules = [
    "core-elements/core-elements.html",
    "paper-elements/paper-elements.html"
];

// Lint Task
gulp.task('lint', function() {
    return gulp.src('app/assets/js/*.js')
        .pipe(jshint())
        .pipe(jshint.reporter('default'));
});

// Compile Our Sass
gulp.task('sass', function() {
    return gulp.src('app/assets/scss/*.scss')
        .pipe(sass())
        .pipe(gulp.dest('public/css'));
});

// Concatenate & Minify JS
gulp.task('global-scripts', function() {
    return gulp.src('app/assets/js/*.js')
        .pipe(concat('global.js'))
        .pipe(gulp.dest('public/js'))
        .pipe(rename('global.min.js'))
        .pipe(uglify())
        .pipe(gulp.dest('public/js'));
});

// Watch Files For Changes
gulp.task('watch', function() {
    gulp.watch('app/assets/js/*.js', ['lint', 'global-scripts']);
    gulp.watch('app/assets/scss/*.scss', ['sass']);
});

gulp.task('polymer', function() {
    // Move Polymer JS File
    gulp.src("polymer/polymer.min.js", {cwd: bower_root})
        .pipe(gulp.dest("public/js/"));

    // Move webcomponents file
    gulp.src(bower_root + "webcomponentsjs/webcomponents.min.js")
        .pipe(gulp.dest("public/js/"));

    // CSS Polymer is shipped with
    gulp.src("polymer/layout.html", {cwd: bower_root})
        .pipe(gulp.dest(webcomponents_dir));

    // Vulcanise 
    gulp.src(polymer_modules, {cwd: bower_root})
        .pipe(vulcanize({
            dest: './public/webcomponents',
            strip: true
        }))
        .pipe(gulp.dest(webcomponents_dir));
});

// Default Task
gulp.task('default', ['lint', 'sass', 'global-scripts', 'polymer']);
Jono20201
  • 3,215
  • 3
  • 20
  • 33

0 Answers0