chore(webpack): tweak config (new favicon dependency)
This commit is contained in:
parent
36f5298c7e
commit
eba0877349
@ -20,7 +20,7 @@ const TerserPlugin = require('terser-webpack-plugin');
|
|||||||
const yaml = require('js-yaml');
|
const yaml = require('js-yaml');
|
||||||
const postcssPresetEnv = require('postcss-preset-env');
|
const postcssPresetEnv = require('postcss-preset-env');
|
||||||
const RemovePlugin = require('remove-files-webpack-plugin');
|
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 crypto = require('crypto');
|
||||||
|
|
||||||
const webpackVersion = require('webpack/package.json').version.split('.').slice(0, 2).join('.');
|
const webpackVersion = require('webpack/package.json').version.split('.').slice(0, 2).join('.');
|
||||||
@ -202,7 +202,7 @@ async function webpackConfig() {
|
|||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (faviconApiVersion) {
|
/* if (faviconApiVersion) {
|
||||||
cacheHash.update(faviconApiVersion);
|
cacheHash.update(faviconApiVersion);
|
||||||
}
|
}
|
||||||
const versionDigest = cacheHash.digest('hex');
|
const versionDigest = cacheHash.digest('hex');
|
||||||
@ -230,15 +230,18 @@ async function webpackConfig() {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
} else {
|
} else { */
|
||||||
const tmpobj = tmp.fileSync({ postfix: ".json" });
|
// const tmpobj = tmp.fileSync({ postfix: ".json" });
|
||||||
fs.writeSync(tmpobj.fd, JSON.stringify(faviconConfig));
|
// fs.writeSync(tmpobj.fd, JSON.stringify(faviconConfig));
|
||||||
fs.close(tmpobj.fd);
|
// fs.close(tmpobj.fd);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
new RealFaviconPlugin({
|
new FaviconsWebpackPlugin({
|
||||||
faviconJson: path.relative(".", tmpobj.name),
|
logo: './assets/favicon.svg',
|
||||||
|
// faviconJson: path.relative(".", tmpobj.name),
|
||||||
outputPath: path.resolve(__dirname, 'well-known', lang),
|
outputPath: path.resolve(__dirname, 'well-known', lang),
|
||||||
|
prefix: 'assets/',
|
||||||
|
cache: true,
|
||||||
inject: false
|
inject: false
|
||||||
}),
|
}),
|
||||||
new CopyPlugin({
|
new CopyPlugin({
|
||||||
|
|||||||
Reference in New Issue
Block a user