2021-12-30 15:57:27 +00:00
|
|
|
const path = require("path")
|
|
|
|
const yaml = require("js-yaml")
|
|
|
|
const fs = require("fs")
|
|
|
|
|
2023-12-03 16:18:09 +00:00
|
|
|
const FaviconsWebpackPlugin = require("favicons-webpack-plugin")
|
2021-12-30 15:57:27 +00:00
|
|
|
const CopyPlugin = require("copy-webpack-plugin")
|
|
|
|
|
|
|
|
let config
|
|
|
|
try {
|
|
|
|
config = yaml.load(fs.readFileSync(path.join(__dirname, "config.yml"), "utf8"))
|
|
|
|
} catch (e) {
|
|
|
|
console.log(e)
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: [path.resolve("src", "dummy.js")],
|
|
|
|
output: {
|
|
|
|
filename: "../build/dummy.js",
|
|
|
|
path: path.join(__dirname, "static"),
|
|
|
|
publicPath: "/",
|
|
|
|
clean: true
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new CopyPlugin({
|
|
|
|
patterns: [
|
|
|
|
{
|
|
|
|
from: "**/*",
|
|
|
|
context: path.resolve(__dirname, "src", "static")
|
2022-09-29 20:04:36 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
from: "sprites/*.svg",
|
|
|
|
to: path.resolve(__dirname, "assets"),
|
|
|
|
context: path.resolve(__dirname, "build")
|
|
|
|
},
|
|
|
|
{
|
|
|
|
from: "img/*.svg",
|
|
|
|
context: path.resolve(__dirname, "build")
|
2021-12-30 15:57:27 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
|
2023-12-03 16:18:09 +00:00
|
|
|
new FaviconsWebpackPlugin({
|
|
|
|
logo: path.resolve("src", "static", "favicon", "favicon.svg"),
|
|
|
|
prefix: "favicon/",
|
|
|
|
inject: false,
|
|
|
|
favicons: {
|
|
|
|
appName: config.title,
|
|
|
|
appShortName: config.title.concat(" - ", config.params.subtitle),
|
|
|
|
appDescription: config.params.description,
|
|
|
|
background: "#2f333e",
|
|
|
|
theme_color: "#2f333e",
|
|
|
|
icons: {
|
|
|
|
android: { offset: 10 },
|
|
|
|
appleIcon: { offset: 10 },
|
|
|
|
appleStartup: { offset: 10 },
|
|
|
|
favicons: true,
|
|
|
|
windows: { offset: 10 },
|
|
|
|
yandex: false
|
|
|
|
}
|
2021-12-30 15:57:27 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}
|