[Solved] Access environment in index.template.html ?
-
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 <% } %>
-
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 }