chore(webpack): tweak config (new favicon dependency)

This commit is contained in:
Sarah Vaupel 2024-01-07 18:15:58 +01:00
parent 36f5298c7e
commit eba0877349

View File

@ -20,7 +20,7 @@ const TerserPlugin = require('terser-webpack-plugin');
const yaml = require('js-yaml');
const postcssPresetEnv = require('postcss-preset-env');
const RemovePlugin = require('remove-files-webpack-plugin');
const RealFaviconPlugin = require('real-favicon-webpack-plugin');
const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
const crypto = require('crypto');
const webpackVersion = require('webpack/package.json').version.split('.').slice(0, 2).join('.');
@ -202,7 +202,7 @@ async function webpackConfig() {
console.error(e);
}
if (faviconApiVersion) {
/* if (faviconApiVersion) {
cacheHash.update(faviconApiVersion);
}
const versionDigest = cacheHash.digest('hex');
@ -230,15 +230,18 @@ async function webpackConfig() {
]
})
];
} else {
const tmpobj = tmp.fileSync({ postfix: ".json" });
fs.writeSync(tmpobj.fd, JSON.stringify(faviconConfig));
fs.close(tmpobj.fd);
} else { */
// const tmpobj = tmp.fileSync({ postfix: ".json" });
// fs.writeSync(tmpobj.fd, JSON.stringify(faviconConfig));
// fs.close(tmpobj.fd);
return [
new RealFaviconPlugin({
faviconJson: path.relative(".", tmpobj.name),
new FaviconsWebpackPlugin({
logo: './assets/favicon.svg',
// faviconJson: path.relative(".", tmpobj.name),
outputPath: path.resolve(__dirname, 'well-known', lang),
prefix: 'assets/',
cache: true,
inject: false
}),
new CopyPlugin({