-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
83 lines (82 loc) · 2.53 KB
/
webpack.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
75
76
77
78
79
80
81
82
83
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WebpackPwaManifest = require('webpack-pwa-manifest');
const WorkboxPlugin = require('workbox-webpack-plugin');
const GoogleTagManagerPlugin = require('webpack-google-tag-manager-plugin');
const path = require('path');
module.exports = {
entry: ['./src/app.js', './src/style.scss'],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 9000
},
plugins: [
new MiniCssExtractPlugin({
filename: 'style.css'
}),
new HtmlWebpackPlugin({
hash: true,
title: 'Mapa nadajników radiowych',
template: './src/index.html',
filename: './index.html',
favicon: './src/assets/favicon.ico'
}),
new WebpackPwaManifest({
fingerprints: false,
name: 'Mapa Nadajników',
short_name: 'Nadajniki',
description: 'Mapa pozwoleń radiowych RRL UKE.',
background_color: '#ffffff',
theme_color: '#2196F3',
start_url: '/?utm_source=a2hs',
display: 'standalone',
ios: {
'apple-mobile-web-app-status-bar-style': 'white'
},
icons: [
{
src: path.resolve('src/assets/icon.png'),
destination: './icons/',
sizes: [96, 128, 192, 256, 384, 512],
ios: true
},
{
src: path.resolve('src/assets/icon.png'),
destination: './icons/',
size: 512,
ios: 'startup'
}
]
}),
new WorkboxPlugin.GenerateSW({
runtimeCaching: [{
urlPattern: /.*/,
handler: 'StaleWhileRevalidate',}]
}),
new GoogleTagManagerPlugin({
id: 'GTM-N79X7MS',
dataLayerName: 'dataLayer',
}),
],
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
],
},
{
test: /\.(jpe?g|gif|png|svg|woff|ttf|wav|mp3)$/,
loader: "file-loader"
}
]
}
}