I want to use htmlWebpackPlugin.options.title
in SFC template, is that doable?
Yes it's doable ...but other way around
htmlWebpackPlugin
to use this ENV variable as the value for title
optiondata
first....env file
VUE_APP_TITLE=My App Title
vue.config.js
module.exports = {
chainWebpack: config => {
config
.plugin('html')
.tap(args => {
args[0].title = process.ENV.VUE_APP_TITLE
return args
})
}
}
SFC
data() {
return {
title: process.ENV.VUE_APP_TITLE
}
}