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

    Conditional compilation for index.template.html

    Help
    2
    3
    846
    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.
    • W
      walfin last edited by

      Hi, is there any way to remove parts of index.template.html depending on mode? E.g. to include some php code only for SPA and not Cordova.

      Alternatively, is it possible to configure quasar.conf.js to set minify to true for htmlWebpackPlugin to remove comments in Cordova mode (the PHP code is contained in <script>/…/</script>?

      dobbel 1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel @walfin last edited by

        @walfin

        Hi, is there any way to remove parts of index.template.html depending on mode? E.g. to include some php code only for SPA and not Cordova.

        I have done something like that to include a different .js in dev vs prod env, don’t know if you can test on SPA vs Cordova…

        // index.template.html
        <% if (htmlWebpackPlugin.options.ctx.dev) { %>
            <script src="statics/js/meteor.bundle.dev.js"></script>
            <% } %>
        
        W 1 Reply Last reply Reply Quote 0
        • W
          walfin @dobbel last edited by

          @dobbel Fantastic, it worked! I checked for htmlWebpackPlugin.options.ctx.mode.spa.

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