rdrew
3 years ago
3 changed files with 0 additions and 9518 deletions
@ -1,96 +0,0 @@
|
||||
'use strict'; |
||||
|
||||
var gulp = require('gulp'); |
||||
var browserSync = require('browser-sync').create(); |
||||
var imagemin = require('gulp-imagemin'); |
||||
var plumber = require('gulp-plumber'); |
||||
var sass = require('gulp-sass'); |
||||
var autoprefixer = require('gulp-autoprefixer'); |
||||
var sourcemaps = require('gulp-sourcemaps'); |
||||
var concat = require('gulp-concat'); |
||||
//var cache = require('gulp-cache');
|
||||
|
||||
|
||||
//===================
|
||||
// Browsersync Proxy
|
||||
//===================
|
||||
|
||||
gulp.task('browser-sync', function() { |
||||
browserSync.init({ |
||||
proxy: "http://rdm2.researchspaces.ca/", |
||||
serveStatic: ['.'], |
||||
files: ['./css/style.css','./js/rdm.js'], |
||||
plugins: ['bs-rewrite-rules'], |
||||
rewriteRules: [ |
||||
{ |
||||
match: '/themes/contrib/rdm_roblib/js/rdm.js', |
||||
replace: '/js/rdm.js' |
||||
}, |
||||
{ |
||||
match: '/themes/contrib/rdm_roblib/css/style.css', |
||||
replace: '/css/style.css' |
||||
} |
||||
] |
||||
}); |
||||
}); |
||||
|
||||
|
||||
//====================
|
||||
// Sass Compilation
|
||||
//===================
|
||||
|
||||
gulp.task('sass', function () { |
||||
return gulp.src('./css/sass/**/*.scss') |
||||
.pipe(sass({ |
||||
//includePaths: ['./node_modules/breakpoint-sass/stylesheets']
|
||||
})) |
||||
.pipe(sourcemaps.init()) |
||||
.pipe(sass().on('error', sass.logError)) |
||||
.pipe(sourcemaps.write('.')) |
||||
.pipe(gulp.dest('./css')); |
||||
}); |
||||
|
||||
//====================
|
||||
// JS Concatination
|
||||
//===================
|
||||
|
||||
gulp.task('js', function () { |
||||
gulp.src('./src/js/*.js') // path to your files
|
||||
.pipe(concat('js.js')) // concat and name it "concat.js"
|
||||
.pipe(gulp.dest('./js/')); |
||||
}); |
||||
|
||||
//====================
|
||||
// Image Optimization
|
||||
//===================
|
||||
|
||||
gulp.task('images', function(){ |
||||
gulp.src('src/img/**/*') |
||||
//.pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
|
||||
.pipe(imagemin([ |
||||
imagemin.jpegtran({progressive: true}), |
||||
imagemin.optipng({optimizationLevel: 5}), |
||||
imagemin.svgo({ |
||||
plugins: [ |
||||
{removeViewBox: true}, |
||||
{cleanupIDs: false} |
||||
] |
||||
}) |
||||
])) |
||||
.pipe(gulp.dest('img/')); |
||||
}); |
||||
|
||||
//==================
|
||||
// Default Gulp Task
|
||||
//=================
|
||||
|
||||
gulp.task ('default',['browser-sync'], function(){ |
||||
//watch sass folder and compile changes
|
||||
gulp.watch('css/sass/**/*.scss', ['sass']); |
||||
//watch js folder and compile changes
|
||||
gulp.watch('src/js/**/*.js', ['js']); |
||||
//watch image folder and optimize
|
||||
gulp.watch('src/img/**/*', ['images']); |
||||
}); |
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,28 +0,0 @@
|
||||
{ |
||||
"name": "bs", |
||||
"version": "1.0.0", |
||||
"description": "", |
||||
"main": "index.js", |
||||
"scripts": { |
||||
"test": "echo \"Error: no test specified\" && exit 1" |
||||
}, |
||||
"author": "", |
||||
"license": "ISC", |
||||
"devDependencies": { |
||||
"breakpoint-sass": "^2.7.1", |
||||
"browser-sync": "^2.24.7", |
||||
"bs-rewrite-rules": "^2.1.2", |
||||
"gulp": "^3.9.1", |
||||
"gulp-autoprefixer": "^6.0.0", |
||||
"gulp-cache": "^1.0.2", |
||||
"gulp-concat": "^2.6.1", |
||||
"gulp-imagemin": "^4.1.0", |
||||
"gulp-plumber": "^1.2.0", |
||||
"gulp-sass": "^4.0.1", |
||||
"gulp-sourcemaps": "^2.6.4" |
||||
}, |
||||
"dependencies": { |
||||
"accordionjs": "^2.1.2", |
||||
"natives": "^1.1.6" |
||||
} |
||||
} |
Loading…
Reference in new issue