S
S
slavamironoff2018-11-29 10:04:47
JavaScript
slavamironoff, 2018-11-29 10:04:47

How to display js constant in pug?

Good day.
Sorry for this question, but how to display a constant in index.pug
Let's say I store some settings in a separate JS file - I define a constant there. The question is how to get it out.5bff8f82e7d3b351449424.png5bff8f8c9f260604782629.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Proskurin, 2018-11-29
@slavamironoff

Do you need to output the constant as a constant/variable, or substitute its value in the JS code? To make it so If as a variable, then, as in normal HTML + JS, you define a variable in the file, include the file in the head tag and use it further. If as a string, then nothing from the JS file. You can store _config.pug in a separate pug file and then connect and use it as a regular variable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question