-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
49 lines (43 loc) · 1.62 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
require('dotenv').config()
const path = require('path')
const Dotenv = require('dotenv-webpack')
module.exports = {
assetPrefix: process.env.APP_URL || 'http://localhost:8989',
serverRuntimeConfig: {
NODE_ENV: process.env.NODE_ENV || 'development',
OSM_DOMAIN: process.env.OSM_DOMAIN || 'https://www.openstreetmap.org',
OSM_API: process.env.OSM_API || process.env.OSM_DOMAIN || 'https://api.openstreetmap.org',
OSM_HYDRA_ID: process.env.OSM_HYDRA_ID || 'manage',
OSM_HYDRA_SECRET: process.env.OSM_HYDRA_SECRET || 'manage-secret',
OSM_CONSUMER_KEY: process.env.OSM_CONSUMER_KEY,
OSM_CONSUMER_SECRET: process.env.OSM_CONSUMER_SECRET,
HYDRA_TOKEN_HOST: process.env.HYDRA_TOKEN_HOST || 'http://localhost:4444',
HYDRA_TOKEN_PATH: process.env.HYDRA_TOKEN_PATH || '/oauth2/token',
HYDRA_AUTHZ_HOST: process.env.HYDRA_AUTHZ_HOST || 'http://localhost:4444',
HYDRA_AUTHZ_PATH: process.env.HYDRA_AUTHZ_PATH || '/oauth2/auth',
HYDRA_ADMIN_HOST: process.env.HYDRA_ADMIN_HOST || 'http://localhost:4445'
},
publicRuntimeConfig: {
APP_URL: process.env.APP_URL || 'http://127.0.0.1:8989',
OSM_NAME: process.env.OSM_NAME || 'OSM'
},
onDemandEntries: {
websocketPort: 3007
},
webpack: (config, { isServer }) => {
config.plugins = config.plugins || []
if (isServer) {
// Possible drivers for knex - IGNORE
config.externals.push(/m[sy]sql|oracle|pg-.+|sqlite\d?/i)
}
config.plugins = [
...config.plugins,
// Read the .env file
new Dotenv({
path: path.join(__dirname, '.env'),
systemvars: true
})
]
return config
}
}