-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
33 lines (29 loc) · 826 Bytes
/
index.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
const { throwUnexpectedConfigError } = require("@craco/craco");
const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
module.exports = {
overrideWebpackConfig: ({
webpackConfig,
pluginOptions,
context: { env }
}) => {
if (pluginOptions && !pluginOptions.logo) {
return throwUnexpectedConfigError({
packageName: "favicons-webpack-plugin",
githubRepo: "jantimon/favicons-webpack-plugin",
message: "You must supply a valid logo param.",
githubIssueQuery: "logo"
});
}
webpackConfig.plugins.push(
new FaviconsWebpackPlugin(
pluginOptions
? {
...pluginOptions,
devMode: env === "production" ? "webapp" : "light"
}
: null
)
);
return webpackConfig;
}
};