-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.config.js
74 lines (73 loc) · 2.01 KB
/
webpack.common.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
const path = require('path')
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { GenerateSW } = require('workbox-webpack-plugin')
const FaviconsWebpackPlugin = require('favicons-webpack-plugin')
module.exports = {
context: __dirname,
entry: './src/index.ts',
output: {
path: path.resolve(__dirname, 'public'),
filename: 'app.bundle.js'
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
transpileOnly: true
}
},
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { importLoaders: 1 } },
'postcss-loader'
]
}
]
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
plugins: [
new TsconfigPathsPlugin()
]
},
plugins: [
new ForkTsCheckerWebpackPlugin(),
new MiniCssExtractPlugin(),
new HtmlWebpackPlugin({
template: 'src/index.html'
}),
new FaviconsWebpackPlugin({
logo: './assets/favicon.png',
favicons: {
appName: 'mkswap - externalize you short term memory',
appShortName: 'mkswap',
appDescription: 'Externalize you short term memory',
developerName: 'Michał Kijowski',
developerURL: 'https://kijowski.dev',
display: 'standalone',
start_url: '/'
}
}),
// new WebpackPwaManifest({
// name: 'mkswap - externalize you short term memory',
// short_name: 'mkswap',
// display: 'standalone',
// description: 'Externalize you short term memory',
// icons: [
// {
// src: path.resolve('assets/favicon.png'),
// sizes: [96, 128, 192, 256, 384, 512],
// destination: 'assets/'
// }
// ]
// }),
new GenerateSW()
]
}