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

    cdn for the built files(js, css)

    Help
    2
    3
    291
    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.
    • H
      hexillion last edited by

      If someone can point me to the right place where to configure so that I can serve the js and css files from a static URL.
      To elaborate
      Once I build my app and deploy on server
      website a.com and b.com can both access it. Here for e.g., Any js or CSS file will be served as ‘a.com/3edhf56.js’ or ‘b.com/3edhf56.js’ this duplicates the assets and CDN cost increases, if I can set these assets with ‘assests.c.com/3edhf56.js’ for both a.com and b.com it would be helpful. Any help on where I can make such a configuration?

      Thanks

      beets 1 Reply Last reply Reply Quote 0
      • beets
        beets @hexillion last edited by beets

        @hexillion You can try something like this in your quasar.conf.js file. This is how I handle the same problem, and it works for me. I think this was the only think I had to do, so give it a shot and report back if it works, or something is still not working.

              extendWebpack (cfg) {
                if(cfg.mode === 'production') {
                  cfg.output.publicPath = 'https://assets.c.com/'
                }
              }
        

        Edit: And of course, just serve this same webroot under assets.c.com, and maybe only allow serving js/css (and maybe images, etc depending on what you bundle,) or at least explicitly deny the index.html file from this assets subdomain.

        H 1 Reply Last reply Reply Quote 0
        • H
          hexillion @beets last edited by

          @beets thanks for the input will try and report back

          1 Reply Last reply Reply Quote 0
          • First post
            Last post