add favicon
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Simon Vieille 2023-01-30 13:59:02 +01:00
parent f940f2fe15
commit 7eb1308d49
Signed by: deblan
GPG key ID: 579388D585F70417
3 changed files with 7 additions and 4 deletions

View file

@ -3,8 +3,7 @@ pipeline:
image: node:16-alpine image: node:16-alpine
commands: commands:
- npm i - npm i
- sed -i "s#setPublicPath('/')#setPublicPath('/og-image')#" webpack.config.js - sed -i "s#APP_BASE_URL = '/'#APP_BASE_URL = '/og-image'#" webpack.config.js src/router.js
- sed -i "s#APP_BASE_URL = '/'#APP_BASE_URL = '/og-image'#" src/router.js
- npm run build - npm run build
update: update:

View file

@ -3,6 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title></title> <title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body class="mx-auto p-4 lg:p-10"> <body class="mx-auto p-4 lg:p-10">
<div id="app" class="bg-grey"></div> <div id="app" class="bg-grey"></div>

View file

@ -1,12 +1,14 @@
const Encore = require('@symfony/webpack-encore') const Encore = require('@symfony/webpack-encore')
const HtmlWebpackPlugin = require('html-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin')
const APP_BASE_URL = '/'
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev') Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev')
Encore Encore
// directory where compiled assets will be stored // directory where compiled assets will be stored
.setOutputPath('public/') .setOutputPath('public/')
.setPublicPath('/') .setPublicPath(APP_BASE_URL)
.setManifestKeyPrefix('')
.addEntry('app', './src/app.js') .addEntry('app', './src/app.js')
.enableSingleRuntimeChunk() .enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild() .cleanupOutputBeforeBuild()
@ -26,10 +28,11 @@ Encore
}) })
.copyFiles({ .copyFiles({
from: './src/img', from: './src/img',
to: 'img/[path][name].[hash:8].[ext]' to: 'img/[path][name].[ext]'
}) })
.addPlugin(new HtmlWebpackPlugin({ .addPlugin(new HtmlWebpackPlugin({
template: 'src/index.html', template: 'src/index.html',
favicon: 'src/img/favicon.svg'
})) }))
.enableSassLoader() .enableSassLoader()
.enableVersioning() .enableVersioning()