-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
64 lines (58 loc) · 1.21 KB
/
next.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
const withSass = require('@zeit/next-sass');
const withCSS = require('@zeit/next-css');
const withFonts = require('next-fonts');
const {
LANDING_BRIDGE,
GRAPHQL_URL,
SERVER_URL,
SOLC_LIST_URL,
SOLC_BIN_URL,
MAP_API_TOKEN,
INSTALL_NODE_LINK,
ECHO_NODE,
EXPLORER_URLS,
SIDECHAIN_EXPLORER_URLS,
MODE,
} = require('config');
const packageJson = require('./package.json');
const chainWrapper = (appConfig) => withFonts(withSass(withCSS(appConfig)));
module.exports = chainWrapper({
env: {
EXPLORER_URLS,
SIDECHAIN_EXPLORER_URLS,
MODE,
ECHO_NODE,
SERVER_URL,
SOLC_LIST_URL,
SOLC_BIN_URL,
LANDING_BRIDGE,
INSTALL_NODE_LINK,
MAP_API_TOKEN,
GRAPHQL_URL_HTTP_LINK: GRAPHQL_URL.HTTP,
GRAPHQL_URL_WS_LINK: GRAPHQL_URL.WS,
APP_VERSION: packageJson.version,
},
webpack: (_config, { isServer, dev }) => {
if (dev) {
_config.devtool = 'cheap-module-source-map';
}
if (!isServer) {
_config.node = {
fs: 'empty',
module: 'empty',
net: 'empty',
tls: 'empty',
};
}
_config.module.rules.push({
test: /\.(ico|png|svg)$/,
use: {
loader: 'url-loader?limit=100000',
options: {
name: '/src/public/images/[name].[ext]',
},
},
});
return _config;
},
});