Answer the question
In order to leave comments, you need to log in
How to remove a tag from production?
How to remove the template tag from production???
This means that the template code does not even get into the compilation.
...
<template v-if="process.env.NODE_ENV !== 'production'">
Видно только в разработке
</template>
...
Answer the question
In order to leave comments, you need to log in
If it is assembled by webpack (for example, from vue cli or quasar), then something like this:
...
<div v-if="dev">
dev
</div >
...
...
computed: {
dev() {
return process.env.DEV;
}
},
...
yes, build via vue cli. But alas, it didn't help. It is clear that it is not visible, but this block does not disappear in the final app.js anyway.
You can of course through javascript, but it's inconvenient. I want a simple and effective solution that removes the code from the final assembly...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question