2020-12-29 21:26:58 +00:00
|
|
|
/* eslint-disable import/no-extraneous-dependencies */
|
2020-09-25 02:29:03 +00:00
|
|
|
const gulp = require('gulp');
|
|
|
|
const del = require('del');
|
|
|
|
const rename = require('gulp-rename');
|
|
|
|
|
|
|
|
const clean = (cb) => {
|
|
|
|
del(['./server/scripts/vendor/auto/**']);
|
|
|
|
cb();
|
|
|
|
};
|
|
|
|
|
2020-12-29 21:26:58 +00:00
|
|
|
const vendorFiles = [
|
2022-11-22 22:19:10 +00:00
|
|
|
'./node_modules/luxon/build/es6/luxon.js',
|
|
|
|
'./node_modules/luxon/build/es6/luxon.js.map',
|
2020-09-25 02:29:03 +00:00
|
|
|
'./node_modules/nosleep.js/dist/NoSleep.js',
|
|
|
|
'./node_modules/jquery/dist/jquery.js',
|
|
|
|
'./node_modules/suncalc/suncalc.js',
|
2020-10-16 20:52:56 +00:00
|
|
|
'./node_modules/swiped-events/src/swiped-events.js',
|
2020-09-25 02:29:03 +00:00
|
|
|
];
|
|
|
|
|
2020-12-29 21:26:58 +00:00
|
|
|
const copy = () => gulp.src(vendorFiles)
|
2020-09-25 02:29:03 +00:00
|
|
|
.pipe(rename((path) => {
|
|
|
|
path.dirname = path.dirname.toLowerCase();
|
|
|
|
path.basename = path.basename.toLowerCase();
|
|
|
|
path.extname = path.extname.toLowerCase();
|
2022-11-22 22:19:10 +00:00
|
|
|
if (path.basename === 'luxon') path.extname = '.mjs';
|
2020-09-25 02:29:03 +00:00
|
|
|
}))
|
|
|
|
.pipe(gulp.dest('./server/scripts/vendor/auto'));
|
|
|
|
|
2020-12-29 21:26:58 +00:00
|
|
|
module.exports = gulp.series(clean, copy);
|