mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
modify workbox path
This commit is contained in:
@@ -114,10 +114,12 @@ func startWebServer(c *cli.Context) error {
|
||||
router.Static("/mobile/css", filepath.Join(config.StaticRootPath, "css"))
|
||||
router.Static("/mobile/img", filepath.Join(config.StaticRootPath, "img"))
|
||||
router.Static("/mobile/fonts", filepath.Join(config.StaticRootPath, "fonts"))
|
||||
router.Static("/mobile/sw", filepath.Join(config.StaticRootPath, "sw"))
|
||||
router.StaticFile("/mobile/favicon.ico", filepath.Join(config.StaticRootPath, "favicon.ico"))
|
||||
router.StaticFile("/mobile/favicon.png", filepath.Join(config.StaticRootPath, "favicon.png"))
|
||||
router.StaticFile("/mobile/touchicon.png", filepath.Join(config.StaticRootPath, "touchicon.png"))
|
||||
router.StaticFile("/mobile/manifest.json", filepath.Join(config.StaticRootPath, "manifest.json"))
|
||||
router.StaticFile("/mobile/sw.js", filepath.Join(config.StaticRootPath, "sw.js"))
|
||||
|
||||
desktopEntryRoute := router.Group("/desktop")
|
||||
desktopEntryRoute.Use(bindMiddleware(middlewares.ServerSettingsCookie(config)))
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ export default {
|
||||
},
|
||||
serviceWorker: {
|
||||
path: self.$settings.isProduction() ? './sw.js' : undefined,
|
||||
scope: '/',
|
||||
scope: './',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+18
-2
@@ -86,8 +86,8 @@ module.exports = {
|
||||
type: "image/png"
|
||||
}
|
||||
],
|
||||
start_url: '/',
|
||||
scope: "/",
|
||||
start_url: './',
|
||||
scope: "./",
|
||||
display: 'standalone',
|
||||
background_color: "#F6F7F8",
|
||||
related_applications: [],
|
||||
@@ -100,6 +100,22 @@ module.exports = {
|
||||
},
|
||||
workboxOptions: {
|
||||
importWorkboxFrom: 'local',
|
||||
importsDirectory: 'sw',
|
||||
precacheManifestFilename: 'precache-manifest.[manifestHash].js',
|
||||
directoryIndex: '/',
|
||||
globDirectory: '.',
|
||||
templatedURLs: {
|
||||
'/': [
|
||||
'src/public/mobile.html'
|
||||
]
|
||||
},
|
||||
exclude: [
|
||||
/^mobile\.html$/,
|
||||
/^desktop\.html$/,
|
||||
/^robots\.txt$/,
|
||||
/^(css|js)\/desktop\.[a-z0-9]+\.js$/,
|
||||
/^(css|js)\/vendors-desktop-bundle\.[a-z0-9]+\.js$/,
|
||||
],
|
||||
skipWaiting: true,
|
||||
clientsClaim: true,
|
||||
swDest: 'sw.js'
|
||||
|
||||
Reference in New Issue
Block a user