thegeeklab/webpack.config.js
Robert Kaussow d5e92052a8
All checks were successful
continuous-integration/drone/push Build is passing
refactor: replace gulp with webpack (#42)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Reviewed-on: #42
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
Co-committed-by: Robert Kaussow <xoxys@rknet.org>
2021-12-30 16:57:27 +01:00

57 lines
1.3 KiB
JavaScript

const path = require("path")
const yaml = require("js-yaml")
const fs = require("fs")
const FaviconsWebpackPlugin = require("favicons-webpack-plugin")
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")
}
]
}),
new FaviconsWebpackPlugin({
logo: path.resolve("src", "static", "favicon", "favicon.svg"),
cache: true,
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,
coast: false
}
}
})
]
}