fixed build
Some checks failed
Build and Deploy Website / Build Website (push) Failing after 15s
Build and Deploy Website / Deploy Dev Website (push) Has been skipped
Build and Deploy Website / Deploy Website (push) Has been skipped

This commit is contained in:
Samuel Philipp 2024-04-10 01:26:43 +02:00
parent 83db4cf10c
commit 1b4a4134fe
2 changed files with 1 additions and 75 deletions

View file

@ -4,7 +4,6 @@
*/ */
var settings = { var settings = {
clean: true, clean: true,
scripts: true,
styles: true, styles: true,
copy: true, copy: true,
reload: true reload: true
@ -17,10 +16,6 @@ var settings = {
var paths = { var paths = {
input: 'src/', input: 'src/',
output: 'dist/', output: 'dist/',
scripts: {
input: 'src/js/*.js',
output: 'dist/js/'
},
styles: { styles: {
input: 'src/scss/*.scss', input: 'src/scss/*.scss',
output: 'dist/css/' output: 'dist/css/'
@ -59,17 +54,10 @@ var banner = {
// General // General
var {src, dest, watch, series, parallel} = require('gulp'); var {src, dest, watch, series, parallel} = require('gulp');
var del = require('del'); var del = require('del');
var flatmap = require('gulp-flatmap');
var lazypipe = require('lazypipe');
var rename = require('gulp-rename'); var rename = require('gulp-rename');
var header = require('gulp-header'); var header = require('gulp-header');
var package = require('./package.json'); var package = require('./package.json');
// Scripts
var concat = require('gulp-concat');
var uglify = require('gulp-terser');
var optimizejs = require('gulp-optimize-js');
// Styles // Styles
var sass = require('gulp-sass')(require('sass')); var sass = require('gulp-sass')(require('sass'));
var postcss = require('gulp-postcss'); var postcss = require('gulp-postcss');
@ -100,62 +88,6 @@ var cleanDist = function (done) {
}; };
// Repeated JavaScript tasks
var jsTasks = lazypipe()
.pipe(header, banner.main, {package: package})
.pipe(optimizejs)
.pipe(dest, paths.scripts.output)
.pipe(rename, {suffix: '.min'})
.pipe(uglify)
.pipe(optimizejs)
.pipe(header, banner.main, {package: package})
.pipe(dest, paths.scripts.output);
// minify, and concatenate scripts
var buildScripts = function (done) {
// Make sure this feature is activated before running
if (!settings.scripts) return done();
// Run tasks on script files
return src(paths.scripts.input)
.pipe(flatmap(function(stream, file) {
// If the file is a directory
if (file.isDirectory()) {
// Setup a suffix variable
var suffix = '';
// If separate polyfill files enabled
if (settings.polyfills) {
// Update the suffix
suffix = '.polyfills';
// Grab files that aren't polyfills, concatenate them, and process them
src([file.path + '/*.js', '!' + file.path + '/*' + paths.scripts.polyfills])
.pipe(concat(file.relative + '.js'))
.pipe(jsTasks());
}
// Grab all files and concatenate them
// If separate polyfills enabled, this will have .polyfills in the filename
src(file.path + '/*.js')
.pipe(concat(file.relative + suffix + '.js'))
.pipe(jsTasks());
return stream;
}
// Otherwise, process the file
return stream.pipe(jsTasks());
}));
};
// Process, and minify Sass files // Process, and minify Sass files
var buildStyles = function (done) { var buildStyles = function (done) {
// Make sure this feature is activated before running // Make sure this feature is activated before running
@ -239,7 +171,6 @@ var watchSource = function (done) {
exports.default = series( exports.default = series(
cleanDist, cleanDist,
parallel( parallel(
buildScripts,
buildStyles, buildStyles,
copyFiles copyFiles
) )

View file

@ -17,17 +17,12 @@
"devDependencies": { "devDependencies": {
"autoprefixer": "10.4.19", "autoprefixer": "10.4.19",
"cssnano": "6.1.2", "cssnano": "6.1.2",
"del": "6.1.1", "del": "7.1.0",
"gulp": "5.0.0", "gulp": "5.0.0",
"gulp-concat": "2.6.1",
"gulp-flatmap": "1.0.2",
"gulp-header": "2.0.9", "gulp-header": "2.0.9",
"gulp-optimize-js": "1.1.0",
"gulp-postcss": "10.0.0", "gulp-postcss": "10.0.0",
"gulp-rename": "2.0.0", "gulp-rename": "2.0.0",
"gulp-sass": "5.1.0", "gulp-sass": "5.1.0",
"gulp-terser": "2.1.0",
"lazypipe": "1.0.2",
"node-sass-tilde-importer": "^1.0.2", "node-sass-tilde-importer": "^1.0.2",
"postcss": "^8.4.38", "postcss": "^8.4.38",
"sass": "^1.74.1" "sass": "^1.74.1"