Answer the question
In order to leave comments, you need to log in
How to create a variable directly accessible in index.html?
Hello, I can read variables through htmlWebpackPlugin.options but how to create my own variable
for example as Value in documentation https://cli.vuejs.org/ru/guide/html-and-static-ass...
Answer the question
In order to leave comments, you need to log in
If you are using Vue-cli then just add to vue.config.js :
module.exports = {
...
configureWebpack: {
plugins: [
new webpack.DefinePlugin({
VAR_NAME: VAR_VALUE,
}),
],
},
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question