PWA: Disable service worker on shared domains #425

This commit is contained in:
Michael Mayer 2021-07-13 22:54:03 +02:00
parent 4fcd009b8b
commit 81629f034d
2 changed files with 12 additions and 3 deletions

View file

@ -56,7 +56,7 @@ import VueInfiniteScroll from "vue-infinite-scroll";
import Hls from "hls.js";
import { $gettext, Mount } from "common/vm";
import * as options from "options/options";
import offline from "@lcdp/offline-plugin/runtime";
import * as offline from "@lcdp/offline-plugin/runtime";
// Initialize helpers
const viewer = new Viewer();
@ -185,4 +185,6 @@ if (navigator.appVersion.indexOf("Chrome/") !== -1) {
// Start application.
Mount(Vue, PhotoPrism, router);
offline.install();
if (config.baseUri === "") {
offline.install();
}

View file

@ -76,7 +76,14 @@ const config = {
}),
new webpack.ProgressPlugin(),
new VueLoaderPlugin(),
new OfflinePlugin(),
new OfflinePlugin({
relativePaths: false,
publicPath: "/",
excludes: ["**/*.txt", "**/share.*"],
rewrites: function (asset) {
return "/static/build/" + asset;
},
}),
],
performance: {
hints: isDev ? false : "error",