UNPKG

3.18 kBTypeScriptView Raw
1export interface FaviconWebpackPlugionOptions {
2 /** our source logo - can be png or svg (required) */
3 logo: string | string[],
4 /** our maskable source logo - can be png or svg (optional) */
5 logoMaskable?: string | string[],
6 /**
7 * Enable caching
8 * Note: disabling caching may increase build times considerably
9 */
10 cache?: boolean,
11 /**
12 *
13 * Inject html links/metadata (requires html-webpack-plugin).
14 * This option accepts arguments of different types:
15 * - boolean
16 * `false`: disables injection
17 * `true`: enables injection if that is not disabled in html-webpack-plugin
18 * - function
19 * any predicate that takes an instance of html-webpack-plugin and returns either
20 * `true` or `false` to control the injection of html metadata for the html files
21 * generated by this instance.
22 */
23 inject?: boolean | ((htmlWebpackPlugin: any) => boolean),
24 /**
25 * Favicons configuration option
26 * @see https://github.com/itgalaxy/favicons
27 */
28 favicons?: Partial<import('favicons').FaviconOptions>,
29 /**
30 * Favicon generation modes
31 * - `light`
32 * the light mode is using the original logo as favicon
33 * this mode has a very fast compilation but limited features
34 * by default this mode is used for development
35 * - `webapp`
36 * the webapp mode is convertig the original logo into different favicons
37 * this mode has a quite slow compilation but wide browser support
38 * by default this mode is used for production
39 */
40 mode?: 'light' | 'webapp' | 'auto',
41 /**
42 * Favicon generation modes used during development
43 * - `light`
44 * the light mode is using the original logo as favicon
45 * this mode has a very fast compilation but limited features
46 * by default this mode is used for development
47 * - `webapp`
48 * the webapp mode is convertig the original logo into different favicons
49 * this mode has a quite slow compilation but wide browser support
50 * by default this mode is used for production
51 */
52 devMode?: 'light' | 'webapp',
53 /**
54 * Web app manifests are part of a collection of web technologies called progressive web apps (PWAs),
55 * which are websites that can be installed to a devices homescreen without an app store.
56 * @see https://developer.mozilla.org/en-US/docs/Web/Manifest
57 *
58 * The manifest option allows to provide a filepath to a base manifest.webmanifest file or a base manifest configuration
59 */
60 manifest?: string | { [key: string]: any }
61 /**
62 * Prefix path for generated assets
63 */
64 prefix?: string,
65 /**
66 * The directory to output the assets relative to the webpack output dir.
67 * Relative string paths are allowed here ie '../public/static'. If this
68 * option is not set, `prefix` is used.
69 */
70 outputPath?: string,
71 /** Override the publicPath option usually read from webpack configuration */
72 publicPath?: string,
73}
74
75
76export type FaviconWebpackPlugionInternalOptions = Required<Omit<FaviconWebpackPlugionOptions,
77 // Optional properties after applying defaults:
78 | 'mode'
79 | 'devMode'
80 | 'publicPath'
81 | 'outputPath'
82>> & FaviconWebpackPlugionOptions
\No newline at end of file