No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Service worker on cordova app

    Help
    2
    5
    2759
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      boriscy last edited by

      I have found a way to add a service worker using this post
      http://forum.quasar-framework.org/topic/134/serve-file-from-root-in-dev-server, it works fine in development but when I create the cordova app the service worker is not available and can’t be registered in my app. How should I solve this problem anyone has experience with this?

      1 Reply Last reply Reply Quote 0
      • rstoenescu
        rstoenescu Admin last edited by

        @boriscy Hi, use Copy Webpack Plugin (https://github.com/kevlened/copy-webpack-plugin) to copy your service worker files to /dist folder in /build/webpack.prod.conf.js.

        1 Reply Last reply Reply Quote 1
        • B
          boriscy last edited by boriscy

          I have the CopyWebpack Plugin and I have not set the to folder is it ok to use this

          new CopyWebpackPlugin([
                {
                  from: 'root/',
                  to: '/dist/root'
                }
              ])
          
          1 Reply Last reply Reply Quote 0
          • rstoenescu
            rstoenescu Admin last edited by

            to must be set to dist as you probably want those files in the root of your app.

            1 Reply Last reply Reply Quote 0
            • B
              boriscy last edited by

              Solution:
              Just use this config to copy to the root folder, it will copy all files to dist/ folder when you run quasar build

              new CopyWebpackPlugin([
                    {
                      from: 'root/',
                      to: ''
                    }
                  ])
              
              1 Reply Last reply Reply Quote 0
              • First post
                Last post