-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnuxt.config.ts
155 lines (136 loc) · 4.01 KB
/
nuxt.config.ts
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import path from 'path'
/* eslint-disable prefer-const */
let { DEPLOYED_NET_ENV, NETWORK_ID, ROCKET_FACTORY_CONTRACT } = process.env
if (DEPLOYED_NET_ENV === 'mainnet') {
NETWORK_ID = '137'
ROCKET_FACTORY_CONTRACT = ''
}
if (DEPLOYED_NET_ENV === 'testnet') {
NETWORK_ID = '80001'
ROCKET_FACTORY_CONTRACT = '0x90647e2337708BacDF0ECa1747feB6A0a9Dc7C98'
}
if (DEPLOYED_NET_ENV === 'local') {
NETWORK_ID = '5777' // ETH DEV `truffle development`
ROCKET_FACTORY_CONTRACT = ''
}
const networkData =
DEPLOYED_NET_ENV === 'mainnet'
? [
{
// 137
chainId: '0x89',
chainName: 'Polygon',
rpcUrls: ['https://polygon-rpc.com/'],
socketRpcUrls: ['wss://matic-mainnet-full-ws.bwarelabs.com'],
nativeCurrency: {
name: 'Matic',
symbol: 'MATIC',
decimals: 18,
},
blockExplorerUrls: ['https://polygonscan.com/'],
},
]
: DEPLOYED_NET_ENV === 'testnet'
? [
{
// 80001
chainId: '0x13881',
chainName: 'Matic Mumbai Testnet',
rpcUrls: [
'https://polygon-mumbai.g.alchemy.com/v2/QG4SdMfiIQGRz5W4unMEwerbvMXrTJfn',
],
socketRpcUrls: [
'wss://polygon-mumbai.g.alchemy.com/v2/QG4SdMfiIQGRz5W4unMEwerbvMXrTJfn',
],
nativeCurrency: {
name: 'Matic',
symbol: 'MATIC',
decimals: 18,
},
blockExplorerUrls: ['https://mumbai.polygonscan.com//'],
},
]
: DEPLOYED_NET_ENV === 'local'
? [
{
// 1337
chainId: '0x539',
chainName: 'Truffle Development Local Net',
rpcUrls: ['HTTP://172.21.32.1:7545', 'HTTP://127.0.0.1:7545'],
socketRpcUrls: ['ws://172.21.32.1:7545', 'ws://127.0.0.1:7545'],
nativeCurrency: {
name: 'Ethereum',
symbol: 'ETH',
decimals: 18,
},
},
]
: [{}]
export default {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
ssr: false,
srcDir: 'src/',
rootDir: './',
// Target: https://go.nuxtjs.dev/config-target
target: 'static',
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'Rocket Protocol',
htmlAttrs: {
lang: 'en',
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: ['~/assets/styles/main.scss'],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
// MAINTAINED ORDER START
{ src: '~/plugins/web3Modal.js', mode: 'client' },
{ src: '~/plugins/web3.js', mode: 'client' },
{ src: '~/plugins/contracts.js', mode: 'client' },
// MAINTAINED ORDER END
// ...
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
build: {
postcss: {
plugins: {
'postcss-custom-properties': false,
tailwindcss: path.resolve(__dirname, 'tailwind.config.js'),
'postcss-pxtorem': {
propList: ['*', '!border*'],
},
},
},
},
buildModules: [
'@nuxt/typescript-build',
'@nuxtjs/stylelint-module',
'@nuxtjs/tailwindcss',
],
modules: ['@nuxtjs/axios', ['nuxt-buefy', { css: false }]],
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
baseURL: '/',
},
publicRuntimeConfig: {
networkData,
NETWORK_ID,
ROCKET_FACTORY_CONTRACT,
},
tailwindcss: {
cssPath: '~/assets/styles/tailwind.css',
configPath: './tailwind.config.js',
exposeConfig: true,
config: {},
},
}