Add prod settings for html interpolation

This commit is contained in:
Ramon Wenger 2021-01-12 22:48:08 +01:00
parent d0f52741e4
commit da3070c774
4 changed files with 6 additions and 5 deletions

View File

@ -56,8 +56,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
filename: 'index.html',
template: 'index.html',
inject: true,
VUE_APP_FAVICON_32: require('../config/dev.env').VUE_APP_FAVICON_32,
VUE_APP_FAVICON_16: require('../config/dev.env').VUE_APP_FAVICON_16
...require('../config/dev.env')
}),
// copy custom static assets
new CopyWebpackPlugin([

View File

@ -46,7 +46,7 @@ const webpackConfig = merge(baseWebpackConfig, {
filename: utils.assetsPath('css/[name].[contenthash].css'),
// Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
allChunks: true,
}),
@ -64,6 +64,7 @@ const webpackConfig = merge(baseWebpackConfig, {
filename: config.build.index,
template: 'index.html',
inject: true,
...require('../config/prod.env'),
minify: {
removeComments: true,
collapseWhitespace: true,

View File

@ -14,6 +14,7 @@ module.exports = {
*/
// vvvv HTML PROPERTIES FROM HERE, NOT STRINGIFIED vvvv
VUE_APP_FAVICON_32: process.env.VUE_APP_FAVICON_32,
VUE_APP_FAVICON_16: process.env.VUE_APP_FAVICON_16
VUE_APP_FAVICON_16: process.env.VUE_APP_FAVICON_16,
VUE_APP_TITLE: process.env.VUE_APP_TITLE
// ^^^^ HTML PROPERTIES TO HERE, NOT STRINGIFIED ^^^^
}

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
<title>mySkillbox</title>
<title><%= htmlWebpackPlugin.options.VUE_APP_TITLE %></title>
<link href='https://fonts.googleapis.com/css?family=Material+Icons' rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,600,800" rel="stylesheet">