Skip to content

My public folder custom css files are not caching in service worker. #7300

@usamamashkoor

Description

@usamamashkoor

Hi I have some custom CSS files in my public folder and i am adding them through index.html file.

Here is my index.html file code

<head>
    <meta charset="utf-8" />
    <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, shrink-to-fit=no"
    />
    <meta name="theme-color" content="#000000" />

    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

  
    <title>Jubzi POS</title>

    <!-- bootstrap css -->
    <link rel="stylesheet" type="text/css" href="/assests/css/bootstrap.min.css">
    <!-- owl carousel css -->
    <link rel="stylesheet" type="text/css" href="/assests/css/owl.carousel.min.css">
    <link rel="stylesheet" type="text/css" href="/assests/css/owl.theme.default.min.css"> -->
    <!-- main stylesheet -->
    <link rel="stylesheet" type="text/css" href="/assests/css/style.css">
    <!-- responsive stylesheet -->
    <link rel="stylesheet" type="text/css" href="/assests/css/responsive.css">
    <script src="/assests/js/plugins/jquery-3.2.1.slim.min.js"></script>

</head>

I am creating a progressive web app using create react app but when i run the command

npm run build

to creeate the production build then when i open my application in the brower then the browser service worker does not cache the above custom public directory css files which are in index.html

Can someone help me how can i resolve this issue so that my app can run offline..

Here is my manifest.json just in case someone needs to see it

{
  "short_name": "Jubzi Pos",
  "name": "Jubzi Pos",
  "icons": [
    {
      "src": "logo@512.png",
      "sizes": "512x512",
      "type": "image/png"
    },
    {
      "src": "logo@256.png",
      "sizes": "256x256",
      "type": "image/png"
    },
    {
      "src": "logo@192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "logo.png",
      "sizes": "128x128 96x96 72x72 64x64 32x32 24x24 16x16",
      "type": "image/png"
    }
  ],
  "start_url": "/",
  "display": "fullscreen",
  "theme_color": "#000000",
  "background_color": "#ffffff"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions