-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.base.js
64 lines (60 loc) · 1.74 KB
/
webpack.config.base.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
53
54
55
56
57
58
59
60
61
62
63
64
const path = require('path');
const HTMLWebpackPlugin = require('html-webpack-plugin');
const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
const apps = require('./apps.json');
const config = {
resolve: {
alias: {
react: 'preact-compat',
'react-dom': 'preact-compat',
},
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'node_modules', 'message-factory'),
path.resolve(__dirname, 'node_modules', 'phoenix'),
],
},
{
test: /(\.(png|jpg)$)/,
loader: 'url-loader',
},
],
},
plugins: [
new FaviconsWebpackPlugin({
logo: './src/assets/images/logo.png',
persistentCache: true,
inject: true,
background: '#fff',
title: 'CSS Quick Draw',
icons: {
android: true,
appleIcon: true,
appleStartup: true,
coast: false,
favicons: true,
firefox: true,
opengraph: false,
twitter: false,
yandex: false,
windows: false,
},
}),
...apps.map(
app =>
new HTMLWebpackPlugin({
chunks: [app.chunk],
title: `${app.title}`,
filename: `${app.filename}.html`,
template: './src/index.tpl.html',
})
),
],
};
module.exports = config;