1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-27 08:40:10 +02:00

fix sw generation

This commit is contained in:
Kushagra Gour
2022-04-06 20:29:39 +05:30
parent a5c218e0cd
commit b23b632bff
2 changed files with 10 additions and 6 deletions

View File

@@ -99,16 +99,20 @@ gulp.task('useRef', function () {
});
gulp.task('concatSwRegistration', function () {
const bundleFile = fs
.readdirSync('app')
.filter(allFilesPaths => allFilesPaths.match(/bundle.*\.js$/) !== null)[0];
console.log('matched', bundleFile);
return gulp
.src(['src/service-worker-registration.js', 'app/script.js'], {
allowEmpty: true
})
.pipe(concat('script.js'))
.src(['src/service-worker-registration.js', `app/${bundleFile}`])
.pipe(concat(bundleFile))
.pipe(gulp.dest('app'));
});
gulp.task('minify', function () {
minifyJs('app/script.js');
// minifyJs('app/script.js');
// minifyJs('app/vendor.js');
minifyJs('app/lib/screenlog.js');