diff --git a/gulpfile.js b/gulpfile.js index 72ba850..2cd1593 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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'); diff --git a/package.json b/package.json index 28be54a..b63a47b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "A blazing fast & offline web playground", "scripts": { "start": "concurrently --kill-others \"gulp start-preview-server\" \"npm run -s dev\"", - "build": "preact build --template src/index.html --prerender false --no-inline-css", + "build": "preact build --template src/index.html --prerender false --no-inline-css --sw false --esm false", "dev": "preact watch --template src/index.html", "serve-website": "cd packages/website; npm start", "build-website": "cd packages/website; npm run build",