-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstatic.config.js
116 lines (112 loc) · 3.58 KB
/
static.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import React from 'react'
export default {
entry: 'index.tsx',
productionSourceMaps: false,
getSiteData: () => ({
title: 'Best of CENNZX'
}),
getRoutes: async () => {
try {
return [
// A route with data
{
path: 'exchange',
template: 'src/pages/exchange/index',
},
// A route with data and dynamically generated child routes
{
path: '/',
template: 'src/pages/exchange/index',
},
{
path: 'liquidity',
template: 'src/pages/liquidity/index',
},
// A 404 component
{
path: '404',
template: 'src/pages/404',
},
];
} catch (error) {
console.error('Error while building the routes!', error.message)
// Don't try to display the stacktrace here, it will cause a strange error
process.exit(1) // throwing an error does not stop the building process
}
},
Document: class CustomHtml extends React.Component {
render() {
const {
Html,
Head,
Body,
children,
state
} = this.props;
return (
<Html lang='en-US'>
<Head>
<meta charSet='UTF-8'/>
<meta name='viewport' content='width=device-width, initial-scale=1'/>
<script src={"/settings/config.js"}></script>
<link href='https://fonts.googleapis.com/css?family=Open+Sans” rel=“stylesheet'/>
<link href='https://fonts.googleapis.com/css?family=Montserrat&display=swap' rel='stylesheet'/>
<link href='https://fonts.googleapis.com/css?family=Montserrat:700&display=swap' rel='stylesheet'/>
</Head>
<Body>{children}</Body>
</Html>
)
}
},
plugins: [
['react-static-plugin-typescript', { typeCheck: false }],
'react-static-plugin-styled-components',
'react-static-plugin-reach-router',
],
resolve: {
alias: {
config: 'settings',
},
},
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
}
],
},
output: {
globalObject: this,
},
optimization: {
runtimeChunk: 'single',
splitChunks: {
cacheGroups: {
vendorOther: {
chunks: 'initial',
enforce: true,
name: 'vendor',
test: /node_modules\/(asn1|bn\.js|buffer|cuint|elliptic|lodash|moment|readable-stream|rxjs)/
},
vendorReact: {
chunks: 'initial',
enforce: true,
name: 'react',
test: /node_modules\/(chart|i18next|react|semantic-ui)/
},
polkadotJs: {
chunks: 'initial',
enforce: true,
name: 'polkadotjs',
test: /node_modules\/(@polkadot\/wasm-(crypto|dalek-ed25519|schnorrkel))/
}
}
}
},
devServer: {
https: process.env.NODE_ENV !== 'development',
contentBase: ['.'],
},
}