A
A
Artem00712017-10-19 11:25:14
Programming
Artem0071, 2017-10-19 11:25:14

How to enable NODE_ENV in index.html?

I use vue-cli
If in main.js I write something like

process.env.NODE_ENV === 'development' ? 'one' : 'two'
, then everything works.
If you write in index.html, then it says that such a variable is not found
How to be in this case?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
E
Eugene Wolf, 2019-07-18
@turbo78

What programming language?
Python, PHP, taking into account the "web" section.
The following question also arises: what languages ​​programs can be embedded on a web page so that people can use this program simply by going through the site?
The language that can be embedded directly on a web page, in general, is JavaScript, but almost all the sites that you see generate pages on the server and give it to you (in the sense of the browser / client) in a ready-made form, and JavaScript is usually serves as an additional language that runs already "on top" of the generated page, although in some cases it may just as well run on the server (ie serve as a server language).
If everything is difficult for you with programming and you believe that learning the N language is one of the difficult aspects of the developer's path and do not want to learn "extra" languages ​​- you can limit yourself to JavaScript, at least for a start. Otherwise, you can additionally (or to begin with) pay attention to one of the languages ​​​​that I voiced above.
PS If you don't have enough programming experience yet, I think it's better to start with Python, at least it doesn't "spoil" beginners as much as PHP.
PS All of the above is solely my personal opinion and it may not coincide with yours (ie the opinion of anyone reading this text [and not just the author of the question]). This is fine. And there is no need to tell me about it in the comments.

A
Alexander Skusnov, 2019-07-19
@AlexSku

Tilda course

D
Dima, 2019-07-20
@v_m_smith

SQL

A
Alex White, 2019-07-20
@kak2z

Do the server part in php, do the front in vue (js) - thanks to this, the back will be understandable and easily maintained, and the front can still be ported to mobile. Thus, you can learn two languages ​​at once.

E
Egor Zhivagin, 2017-10-19
@Krasnodar_etc

Variable from JS in html file?
Use template engines, then there will be such an option

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question