-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfavicons.config.js
49 lines (45 loc) · 1.3 KB
/
favicons.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const path = require("path");
const tailwindConf = require("./tailwind.config.js");
const dotenv = require("dotenv").config({ path: __dirname + "/.env" });
// Plugins
const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const PATHS = {
public: path.join(__dirname, "public"),
templates: path.join(__dirname, "templates"),
favicon: path.join(__dirname, "tailoff", "/img"),
ejs: path.join(__dirname, "tailoff", "/ejs"),
};
module.exports = (env) => {
return {
mode: "production",
entry: {
main: `${PATHS.favicon}/favicon.js`,
},
output: {
publicPath: "/",
path: `${PATHS.public}`,
filename: "assets/favicon.js",
},
plugins: [
new HtmlWebpackPlugin({
filename: `${PATHS.templates}/_snippet/_global/_favicon.twig`,
template: `${PATHS.ejs}/favicon.ejs`,
inject: false,
files: {
css: [],
},
}),
new FaviconsWebpackPlugin({
logo: `${PATHS.favicon}/favicon.svg`,
devMode: "webapp",
cache: true,
favicons: {
appName: dotenv.parsed.SYSTEM_NAME,
appDescription: dotenv.parsed.SYSTEM_NAME,
theme_color: tailwindConf.theme.colors.primary.default,
},
}),
],
};
};