Answer the question
In order to leave comments, you need to log in
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.
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question