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

    [Solved] Access environment in index.template.html ?

    Framework
    environment
    1
    2
    318
    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.
    • J
      jitendra16 last edited by jitendra16

      I want to have a block of code in the production build only. Below is what I tried, but don’t know how to access environment?

      <% if (htmlWebpackPlugin.options.environment !== 'dev') { %>
        // insert something in production only
      <% } %>
      
      J 1 Reply Last reply Reply Quote 0
      • J
        jitendra16 @jitendra16 last edited by jitendra16

        Solved it by “htmlWebpackPlugin.options.process.env.isdev”

        my quasar.conf includes following

         env: ctx.dev ? { // so on dev we'll have
                isdev: true
              } : { // and on build (production):
                isdev: false
              }
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post