Skip to content

Commit

Permalink
Use gulp-hash-filename npm package in place of gulp-hash.
Browse files Browse the repository at this point in the history
The latter causes an error with the latest gulp.
  • Loading branch information
steveblamey committed Dec 30, 2017
1 parent 8e7888f commit 0ae4c17
Show file tree
Hide file tree
Showing 4 changed files with 5,734 additions and 19 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# npm/gulp
node_modules/
dist/
package-lock.json

# These should go in /var on production systems, but we'll leave them for now
data/cache/**
Expand Down
34 changes: 17 additions & 17 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// gulpfile.js for uzERP
//
//
// Steve Blamey <[email protected]>
// License GPLv3 or later
// Copyright (c) 2017 uzERP LLP (support#uzerp.com). All rights reserved.

var gulp = require('gulp');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var less = require('gulp-less');
var minify = require('gulp-clean-css');
var merge = require('merge-stream');
var hash = require('gulp-hash');
var hash = require('gulp-hash-filename');
var clean = require('gulp-clean');
var wrap = require('gulp-wrap');

Expand Down Expand Up @@ -63,15 +63,15 @@ var jsFiles = [
// uzLET js
'modules/public_pages/**/resources/js/*.uzlet.js'
],

cssHead = [
'assets/css/reset.css',
];

lessHead = [
`${less_source}/theme.less`,
];

cssFiles = [
// jQuery CSS files
`${less_source_libs}/jquery.watermark-3.1.1/jquery.watermark.css`,
Expand All @@ -82,15 +82,14 @@ var jsFiles = [
'assets/js/vendor/strengthify/strengthify.css',
'modules/public_pages/**/resources/css/**/*.css',
];

lessFiles = [
'modules/public_pages/**/*.less',
'!modules/public_pages/login/resources/css/login.less'
];

jsDest = 'dist/js';
cssDest = 'dist/css';


gulp.task('clean-scripts', function () {
return gulp.src(['dist/js/**/*.js',], {read: false})
Expand All @@ -104,16 +103,17 @@ gulp.task('clean-styles', function () {
});


gulp.task('scripts', function() {
return gulp.src(jsFiles)
gulp.task('scripts', function() {
var stream = gulp.src(jsFiles)
.pipe(concat('scripts.js'))
.pipe(rename('scripts.min.js'))
.pipe(hash())
.pipe(uglify())
.pipe(gulp.dest(jsDest));
return stream;
});

gulp.task('dev-scripts', function() {
gulp.task('dev-scripts', function() {
return gulp.src(jsFiles)
.pipe(wrap('// <%= file.path %>\n<%= contents %>'))
.pipe(concat('scripts.js'))
Expand All @@ -138,11 +138,11 @@ gulp.task('dev-module-scripts', function () {
gulp.task('styles', function() {
var cssHeadStream = gulp.src(cssHead)
.pipe(concat('css-head.css'));

var lessHeadStream = gulp.src(lessHead)
.pipe(less())
.pipe(concat('less-head.less'));

var cssStream = gulp.src(cssFiles)
.pipe(concat('css-files.css'));

Expand All @@ -164,12 +164,12 @@ gulp.task('dev-styles', function() {
var cssHeadStream = gulp.src(cssHead)
.pipe(wrap('/* <%= file.path %> */\n<%= contents %>'))
.pipe(concat('css-head.css'));

var lessHeadStream = gulp.src(lessHead)
.pipe(wrap('/* <%= file.path %> */\n<%= contents %>'))
.pipe(less())
.pipe(concat('less-head.less'));

var cssStream = gulp.src(cssFiles)
.pipe(wrap('/* <%= file.path %> */\n<%= contents %>'))
.pipe(concat('css-files.css'));
Expand All @@ -188,7 +188,7 @@ gulp.task('dev-styles', function() {
});


gulp.task('login-styles', function() {
gulp.task('login-styles', function() {
return gulp.src('modules/public_pages/login/resources/css/login.less')
.pipe(less({paths: [`${less_source}`,]}))
.pipe(hash())
Expand Down
Loading

0 comments on commit 0ae4c17

Please sign in to comment.