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

    Simple Question: How to pass 'buildDir' and 'showProgress' on commandline

    CLI
    2
    2
    239
    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.
    • T
      tmulle last edited by tmulle

      Hi,

      We’d like to pass in the ‘buildDir’ and ‘showProgress’ values from the commandline into the build section of quasar.conf.js

      For example,

      We’d like to do this:

      WEB_BUILD_DIR=/someBuildDir
      WEB_BUILD_SHOW_PROGRESS=false
      

      and then run quasar build and have it NOT show the progress bar and build to the output directory we specify.

      AND… if either of those values are not present then default to their default values.

      I’m tried this in the build section of quasar.conf.js and I have partial luck. I don’t know how to tell the script to use default values IF those. values are not present on the command line or process.env. Javascript/Web UI isn’t my strong point. I’m a backend developer by trade.

      // quasar.conf.js

      {
      
      build: {
            distDir: process.env.WEB_BUILD_DIR,
            showProgress: process.env.WEB_BUILD_SHOW_PROGRESS,
            scopeHoisting: true,
           ... // rest of config
          },
      }
      

      Thanks…

      T 1 Reply Last reply Reply Quote 0
      • T
        tof06 @tmulle last edited by

        @tmulle Did you try to use || operator ?

        {
        
        build: {
              distDir: process.env.WEB_BUILD_DIR || 'default/dist/dir',
              showProgress: process.env.WEB_BUILD_SHOW_PROGRESS || true,
              scopeHoisting: true,
             ... // rest of config
            },
        }
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post