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

    How to pass information to build process

    Framework
    2
    2
    132
    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.
    • E
      ericg97477 last edited by

      I have what may be an unusual situation. In my Quasar based app, I have a constants.js file. In this file, there are several constants defined whose values need to be based upon the physical machine the app is running on. The machine will always be unix based with a fixed hostname.

      Now, I believe that process.env and quasar.conf.js can be helpful here in that I can setup a custom variable that could contain the hostname that I am building for. I suppose I could construct a Makefile that manipulates quasar.conf.js and then runs quasar build.

      Does that seem like the right / good solution?

      Has anyone faced a similar situation? How have you resolved it?

      1 Reply Last reply Reply Quote 0
      • Hawkeye64
        Hawkeye64 last edited by Hawkeye64

        @ericg97477 There are a couple of app extensions that could be useful.

        1. https://github.com/quasarframework/app-extension-dotenv
        2. https://github.com/quasarframework/app-extension-qenv
          Both of then read in external files and dev/build time so in browser you have access to vars via process.env
          You could create a small js app that reads your constants and generate those files (depending on which app extension you use)
        1 Reply Last reply Reply Quote 0
        • First post
          Last post