This repository was archived by the owner on May 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.settings.js
More file actions
98 lines (97 loc) · 2.16 KB
/
webpack.settings.js
File metadata and controls
98 lines (97 loc) · 2.16 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
require('dotenv').config();
module.exports = {
name: 'Therapy homepage',
copyright: 'Ilya Klimov',
paths: {
src: {
base: 'src/',
css: 'src/css/',
js: 'src/js/',
},
build: {
base: 'build',
clean: ['./**/*'],
},
public: 'public',
},
urls: {
live: '/',
local: '/',
critical: '/',
publicPath: './',
},
vars: {
cssName: 'styles',
},
entries: {
app: 'index.tsx',
},
copyWebpackConfig: [
{
from: './src/js/workbox-catch-handler.js',
to: '[name].[ext]',
},
],
criticalCssConfig: {
base: '/build/criticalcss/',
suffix: '_critical.min.css',
criticalHeight: 1200,
criticalWidth: 1200,
ampPrefix: 'amp_',
ampCriticalHeight: 19200,
ampCriticalWidth: 600,
pages: [
{
url: '',
template: 'index',
},
],
},
devServerConfig: {
public: () => process.env.DEVSERVER_PUBLIC || 'http://localhost:3000',
host: () => process.env.DEVSERVER_HOST || 'localhost',
poll: () => process.env.DEVSERVER_POLL || true,
port: () => process.env.DEVSERVER_PORT || 3000,
https: () => process.env.DEVSERVER_HTTPS || false,
},
manifestConfig: {
basePath: '',
},
saveRemoteFileConfig: [
{
url: 'https://www.google-analytics.com/analytics.js',
filepath: 'analytics.js',
},
],
createSymlinkConfig: [
{
origin: 'img/favicons/favicon.ico',
symlink: 'favicon.ico',
},
],
webappConfig: {
logo: './src/img/favicon-src.png',
prefix: 'img/favicons/',
},
workboxConfig: {
swDest: 'sw.js',
precacheManifestFilename: 'precache-manifest.[manifestHash].js',
importScripts: ['/build/workbox-catch-handler.js'],
exclude: [/\.(png|jpe?g|gif|svg|webp)$/i, /\.map$/, /^manifest.*\\.js(?:on)?$/],
globDirectory: 'build',
globPatterns: ['offline.html', 'offline.svg'],
offlineGoogleAnalytics: true,
runtimeCaching: [
{
urlPattern: /\.(?:png|jpg|jpeg|svg|webp)$/,
handler: 'cacheFirst',
options: {
cacheName: 'images',
expiration: {
maxEntries: 20,
},
},
},
],
},
};