remix-pwa / monorepo

Remix PWA v4
https://remix-pwa.run
MIT License
105 stars 23 forks source link

__workerManifest.assets is missing entry for manifest-{version}.js #240

Open aschultz opened 2 months ago

aschultz commented 2 months ago

Remix generates a file like assets/manifest-12345.js that contains the list of routes and their dependencies, and links to this from the HTML doc. But RemixPWA isn't including it in the __workerManifest.assets list, which makes it tricky to ensure that file gets cached for offline use.

I think maybe the PWA vite plugin that generates the assets list is running before Remix generates the manifest file?

//package.json
"dependencies": {
    "@remix-pwa/sw": "^3.0.7",
    "@remix-pwa/worker-runtime": "^2.1.2",
    "@remix-run/node": "^2.9.2",
    "@remix-run/react": "^2.9.2",
    "@remix-run/serve": "^2.9.2",
    "isbot": "^5.1.7",
    "react": "^18.3.1",
    "react-dom": "^18.3.1"
},
"devDependencies": {
    "@remix-pwa/dev": "^3.0.5",
    "@remix-run/dev": "^2.9.2",
    "@types/react": "^18.3.3",
    "cross-env": "^7.0.3",
    "vite": "^5.2.12"
}
//vite.config.js
export default defineConfig({
  build: {
    minify: false
  },
  plugins: [
    remix({
        ssr: true,
    }),
    remixPWA()],
});
ShafSpecs commented 2 months ago

Thanks for bringing this to attention! I would take a look when I am free 👍