-
Notifications
You must be signed in to change notification settings - Fork 0
/
preact.config.js
52 lines (49 loc) · 1.98 KB
/
preact.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
50
51
52
import FaviconsWebpackPlugin from 'favicons-webpack-plugin'
import { resolve } from 'path'
export default {
/**
* Function that mutates the original webpack config.
* Supports asynchronous changes when a promise is returned (or it's an async function).
*
* @param {object} config - original webpack config.
* @param {object} env - options passed to the CLI.
* @param {WebpackConfigHelpers} helpers - object with useful helpers for working with the webpack config.
* @param {object} options - this is mainly relevant for plugins (will always be empty in the config), default to an empty object
**/
webpack(config, env, helpers, options) {
config.module.rules[4].use.splice(1, 0, {
loader: '@teamsupercell/typings-for-css-modules-loader',
options: {
banner: '// This file is automatically generated from your CSS. Any edits will be overwritten.',
disableLocalsExport: true
}
})
// Use any `index` file, not just index.js
config.resolve.alias['preact-cli-entrypoint'] = resolve(process.cwd(), 'src', 'index')
config.plugins.push(new FaviconsWebpackPlugin({
logo: './assets/rtype.png',
cache: true,
inject: true,
favicons: {
appName: 'svenvowe.de',
appDescription: 'Hello',
developerName: 'Sven Vowe',
background: '#1e1e1e',
theme_color: '#1e1e1e',
appleStatusBarStyle: 'black-translucent',
orientation: 'portrait',
pixel_art: true,
icons: {
favicons: true,
android: true,
appleIcon: true,
yandex: true,
coast: true,
firefox: false,
appleStartup: false,
windows: false
}
}
}))
}
}