jubilee/gulp/build.js
2019-01-07 13:47:53 +00:00

76 lines
2.5 KiB
JavaScript

const gulp = require('gulp');
const autoprefixer = require('gulp-autoprefixer');
const cssnano = require('gulp-cssnano');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const concat = require('gulp-concat');
const cache = require('gulp-cache');
const htmlmin = require('gulp-htmlmin');
const inject = require('gulp-inject');
const del = require('del');
const htmlreplace = require('gulp-html-replace');
const scss = require('gulp-scss');
const sass = require('gulp-sass');
const googleWebFonts = require('gulp-google-webfonts');
const fontOptions = { };
gulp.task('styles', function() {
return gulp.src(['node_modules/backbone.modal/backbone.modal.css', 'node_modules/backbone.modal/backbone.modal.theme.css'])
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
/* .pipe(gulp.dest('dist/css'))*/
/* .pipe(rename({suffix: '.min'}))*/
.pipe(concat('style.min.css'))
.pipe(cssnano())
.pipe(gulp.dest('live/css'));
});
gulp.task('copy', function() {
gulp.src(['src/img/**/*']).pipe(gulp.dest('live/img'));
gulp.src(['src/gfx/**/*']).pipe(gulp.dest('live/gfx'));
gulp.src(['src/browserconfig.xml', 'src/site.webmanifest', 'src/service-worker.js', 'src/bridger.js']).pipe(gulp.dest('live'));
gulp.src(['src/v1/index.html']).pipe(gulp.dest('live'));
});
gulp.task('clean', function() {
return del(['live']);
});
gulp.task('customMUI', function() {
return gulp.src(['src/css/custom.scss'])
.pipe(sass({ 'outputStyle': 'compressed' }).on('error', sass.logError))
// .pipe(cssnano())
.pipe(rename('mui.custom.css'))
// .pipe(gulp.dest(`${dest}/css`));
.pipe(gulp.dest('live/css'));
});
gulp.task('vendor', function() {
return gulp.src([
'node_modules/muicss/dist/js/mui.min.js'
])
.pipe(concat('vendor.js'))
/* .pipe(uglify({ 'mangle': false }))*/
.pipe(gulp.dest('live/js'));
});
gulp.task('fonts', function() {
return gulp.src('src/fonts.list')
.pipe(googleWebFonts(fontOptions))
.pipe(gulp.dest('live/fonts'))
;
});
gulp.task('gotham', function() {
gulp.src(['fonts/gotham.css']).pipe(gulp.dest('live/fonts'));
gulp.src(['fonts/GothamSSm-Black.otf', 'fonts/GothamSSm-Bold.otf', 'fonts/GothamSSm-Book.otf', 'fonts/GothamSSm-Light.otf', 'fonts/GothamSSm-Medium.otf']).pipe(gulp.dest('live/fonts'));
});
gulp.task('fujicons', function() {
gulp.src(['fonts/fujicons.css']).pipe(gulp.dest('live/fonts'));
gulp.src(['fonts/fujicons.ttf']).pipe(gulp.dest('live/fonts'));
});