-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
86 lines (85 loc) · 2.73 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
84
85
86
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: 8080
},
plugins: [
new MiniCssExtractPlugin({
filename: 'style.css'
}),
new HtmlWebpackPlugin({
hash: true,
title: 'rocket.watch',
template: './src/index.html',
filename: './index.html',
favicon: './src/assets/favicon.ico'
}),
new WebpackPwaManifest({
fingerprints: false,
name: 'rocket.watch',
short_name: 'rocket.watch',
description: 'Watch rocket launches live!',
background_color: '#151b23',
theme_color: '#1c2530',
start_url: '/?utm_source=a2hs',
display: 'fullscreen',
ios: {
'apple-mobile-web-app-status-bar-style': 'black'
},
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'
}
],
gcm_sender_id: "482941778795",
gcm_sender_id_comment: "Do not change the GCM Sender ID",
related_applications: [{
"platform": "play",
"id": "pl.yasiu.rocketwatch"
}]
}),
new WorkboxPlugin.InjectManifest({
swSrc: './src/serviceworker.js',
swDest: 'OneSignalSDKWorker.js'
}),
new GoogleTagManagerPlugin({
id: 'GTM-PBBB4LF',
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"
}
]
}
}