-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
71 lines (67 loc) · 2.8 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
65
66
67
68
69
70
71
const ip = require('ip');
const withCSS = require('@zeit/next-css');
const withBundleAnalyzer = require('@zeit/next-bundle-analyzer');
const PORT = 3004;
const debugMobile = false;
const host = debugMobile ? ip.address() : 'localhost';
module.exports = withBundleAnalyzer(
withCSS({
webpack(config) {
config.module.rules.push({
test: /\.(eot|woff|woff2|ttf|svg|png|jpg|gif)$/,
use: {
loader: 'url-loader',
options: {
limit: 100000,
name: '[name].[ext]',
},
},
});
return config;
},
analyzeServer: ['server', 'both'].includes(process.env.BUNDLE_ANALYZE),
analyzeBrowser: ['browser', 'both'].includes(process.env.BUNDLE_ANALYZE),
bundleAnalyzerConfig: {
server: {
analyzerMode: 'static',
reportFilename: '../bundles/server.html',
},
browser: {
analyzerMode: 'static',
reportFilename: '../bundles/client.html',
},
},
serverRuntimeConfig: {
PORT: process.env.PORT || PORT,
ENV: process.env.NODE_ENV || 'development',
GQL_SERVER_URL: process.env.GQL_SERVER_URL || `http://${host}:${PORT}/graphql`,
MONGO_SERVER_URL:
process.env.MONGO_SERVER_URL ||
'mongodb://divinaapp:[email protected]:59692/divina-app',
AUTH0_DOMAIN: process.env.AUTH0_DOMAIN || 'divinaapp.eu.auth0.com',
AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID || 'wn37BZhm1Zx-l2_B1D7oJJHJgm7R6dhc',
AUTH0_CLIENT_SECRET:
process.env.AUTH0_CLIENT_SECRET ||
'WdVYhMdzI95F4axV_hi0AqZS9V-GGY6PzBpd9ni32z2i0RAp4ptoZBL-RPeIZdi_',
AUTH0_CALLBACK_URL:
process.env.AUTH0_CALLBACK_URL || `http://${host}:${process.env.PORT || PORT}/callback`,
SEC_COOKIE: process.env.SEC_COOKIE || false,
CLOUDINARY_UPLOAD_URL:
process.env.CLOUDINARY_UPLOAD_URL || 'https://api.cloudinary.com/v1_1/da9cucer2/upload',
CLOUDINARY_PRESET: process.env.CLOUDINARY_PRESET || 'ov3f36hw',
SESSION_SECRET: process.env.SESSION_SECRET || 'fsdffsdlfkjsoiuyd65876sbe',
NPM_VERSION: process.env.npm_package_version || '---',
},
publicRuntimeConfig: {
GQL_SERVER_URL: process.env.GQL_SERVER_URL || `http://${host}:${PORT}/graphql`,
GQL_WS_SERVER_URL: process.env.GQL_WS_SERVER_URL || `ws://${host}:${PORT}/graphql`,
CLOUDINARY_UPLOAD_URL:
process.env.CLOUDINARY_UPLOAD_URL || 'https://api.cloudinary.com/v1_1/da9cucer2/upload',
CLOUDINARY_PRESET: process.env.CLOUDINARY_PRESET || 'ov3f36hw',
NPM_VERSION: process.env.npm_package_version || '---',
SERVER_URL: process.env.server_url || 'https://app.divinaapp.com',
ANALYTICS_TRACKING_ID: process.env.ANALYTICS_TRACKING_ID || 'UA-137727478-2',
FB_APP_ID: process.env.fb_app_id || '1217981644879628',
},
}),
);