Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Trying to make payload application pwa.

default discord avatar
anisulislampranto6 months ago
6

So i am trying to make my payload app pwa. So as far as i know i have to do some modification from public folders manifest.json file. But in payload application we don't have that. But from ai help i got to know about adding public folder.



but it is not working as expected. if we check the browser application tab we can see that it is not getting the manifest.json file.

  • default discord avatar
    paulpopuslast year

    What are you trying to achieve with payload app as pwa?


    AFAIK I haven't seen anyone do this before (then again I don't see many pwas these days) so you're treading pretty unknown grounds

  • default discord avatar
    anisulislamprantolast year

    yeah. that's true. but it is possible right ? i mean making it pwa.



    So this application is being served as front end as well. i am using custom routes and components so that's why it will be a webapp for the users and for flexibility i am trying to make it pwa.

  • discord user avatar
    tylandavis
    last year

    I'm not super familiar with building PWAs, but I imagine you may need to modify the

    index.html

    file that's served after building to include a link to the

    manifest.json

    file.

  • default discord avatar
    paulpopuslast year

    Yeah it's possible, you will want to modify the webpack configuration, and by default Payload doesn't serve any

    public

    folder



    for the latter you wanna update the build step of copyfiles


    "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png}\" dist/",

    you see its copying all those file extensions, add one for your .json or simply create a new step to copy a whole folder into dist too



    I don't think you need to modify the webpack config actually

  • default discord avatar
    generator101last year

    Are you trying to make an offline application?

  • default discord avatar
    brianjm6 months ago
    @854751864707874817

    Did you make any progress in this?

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.