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

    Handle multiple Environments

    Help
    3
    5
    2515
    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
      helpmelearn last edited by

      Kind of two parts.

      What I need is some quasar test command. I think test would be closer to production then to dev.
      Something like quasar test would build with a QA url as some variable.
      Eventually will need this with cordova. quasar build android --QA

      Really what is needed is a way to tell the vue code which server to point to.
      Local host would be local host (or an ip address)
      Dev would point to dev.server.com
      Test would point to qa.server.com
      prod would point to www.server.com

      I know webpack can do this, Quasar seems to have its own configuration.

      Another question is how to include this in some “services” javascript file. Vue doesn’t have services, sounds like just creating a JS file with some axios commands in. This is where I need to know which server I’m pointing to.

      Thanks

      1 Reply Last reply Reply Quote 0
      • L
        leon last edited by

        Related to http://forum.quasar-framework.org/topic/1850/more-environments

        1 Reply Last reply Reply Quote 0
        • L
          leon last edited by leon

          Hi i understood @rstoenescu in http://forum.quasar-framework.org/topic/1827/build-for-environments-other-than-development-and-production/2

          With the code

             build: {
                scopeHoisting: true,
                vueRouterMode: 'history',
                env: {
                  PROD: process.env.prod === '1'
                },
          

          Example windows:
          set prod =1 && quasar build -> in application will acess process.env.PROD = 1
          set prod =0 && quasar build -> in application will acess process.env.PROD = 0

          Example linux:
          export prod =1 && quasar build -> in application will acess process.env.PROD = 1
          export prod =0 && quasar build -> in application will acess process.env.PROD = 0

          1 Reply Last reply Reply Quote 0
          • L
            leon last edited by

            If you want, can create N envs
            Just change the value of OS env

             build: {
                  scopeHoisting: true,
                  vueRouterMode: 'history',
                  env: {
                    PROD: process.env.prod === '1'
                    STAGE: process.env.prod === '2'
                    TEST: process.env.prod === '3'
                    QA: process.env.prod === '4'
                  },
            1 Reply Last reply Reply Quote 0
            • D
              danikane last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • First post
                Last post