62 lines
1.5 KiB
JavaScript
62 lines
1.5 KiB
JavaScript
const path = require("path")
|
|
const yaml = require("js-yaml")
|
|
const fs = require("fs")
|
|
|
|
const WebpackFavicons = require("webpack-favicons")
|
|
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")
|
|
},
|
|
{
|
|
from: "sprites/*.svg",
|
|
to: path.resolve(__dirname, "assets"),
|
|
context: path.resolve(__dirname, "build")
|
|
},
|
|
{
|
|
from: "img/*.svg",
|
|
context: path.resolve(__dirname, "build")
|
|
}
|
|
]
|
|
}),
|
|
|
|
new WebpackFavicons({
|
|
src: path.resolve("src", "static", "favicon", "favicon.svg"),
|
|
path: "favicon/",
|
|
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,
|
|
coast: false
|
|
}
|
|
})
|
|
]
|
|
}
|