-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
54 lines (47 loc) · 1.38 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
const dotEnvResult = require('dotenv').config()
const prod = process.env.NODE_ENV === 'production'
if (dotEnvResult.error) {
throw dotEnvResult.error
}
module.exports = {
env: {
TEST: process.env.TEST,
apiKey: process.env.apiKey,
authDomain: process.env.authDomain,
databaseURL: process.env.databaseURL,
projectId: process.env.projectId,
storageBucket: process.env.storageBucket,
messagingSenderId: process.env.messagingSenderId,
appId: process.env.appId
},
webpack: function (cfg) {
const originalEntry = cfg.entry
cfg.entry = async () => {
const entries = await originalEntry()
if (
entries['main.js'] &&
!entries['main.js'].includes('./client/polyfills.js')
) {
entries['main.js'].unshift('./client/polyfills.js')
}
return entries
}
return cfg
},
exportPathMap: async function(defaultPathMap) {
return {
'/': { page: '/' },
'/profile': { page: '/profile' },
'/myteams': { page: '/myteams' },
'/teams': { page: '/teams' },
'/teach': { page: '/teach' },
'/teamreg': { page: '/teamreg' },
'/regconfirm': { page: '/regconfirm' },
'/teachList': { page: '/teachList' },
'/teamList': { page: '/teamList' },
'/privacy': { page: '/privacy' },
'/agreement': { page: '/agreement' },
'/company': { page: '/company' },
}
}
}