forked from ThatConference/that-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
76 lines (68 loc) · 2.17 KB
/
Copy pathnext.config.js
File metadata and controls
76 lines (68 loc) · 2.17 KB
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
const dotenv = require('dotenv');
const nextSourceMaps = require('@zeit/next-source-maps');
const webpack = require('webpack');
const { version } = require('./package.json');
dotenv.config();
const sourceMaps = nextSourceMaps({
webpack: (config, { isServer, buildId }) => {
config.plugins.push(
new webpack.DefinePlugin({
'process.env.SENTRY_RELEASE': JSON.stringify(buildId),
}),
);
config.module.rules.push({
test: /\.md$/,
use: 'raw-loader',
});
// config.module.rules.push({
// test: /\.js$/,
// exclude: /node_modules/,
// loader: 'eslint-loader',
// options: {
// emitError: true,
// emitWarning: false,
// failOnError: false,
// failOnWarning: false,
// },
// });
if (!isServer) {
// eslint-disable-next-line no-param-reassign
config.resolve.alias['@sentry/node'] = '@sentry/browser';
}
console.log(`buildId ${buildId}`);
return config;
},
});
const generateBuildId = async () => {
// return `that-website@${version}-xyz880`;
const gitsha = process.env.NOW_GITHUB_COMMIT_SHA;
if (gitsha) {
return `that-website@${version}-${gitsha.substring(0, 6)}`;
}
return null;
};
module.exports = {
target: 'serverless',
pageExtensions: ['js', 'jsx', 'md', 'mdx'],
env: {
SENTRY_DSN: process.env.SENTRY_DSN,
API_GATEWAY: process.env.API_GATEWAY,
WI_PROSPECTUS_URL:
'https://storage.googleapis.com/that-bucket/2020_THATConference_Prospectus.pdf',
AUTH0_DOMAIN: process.env.AUTH0_DOMAIN,
AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID,
AUTH0_CLIENT_SECRET: process.env.AUTH0_CLIENT_SECRET,
AUTH0_AUDIENCE: process.env.AUTH0_AUDIENCE,
AUTH0_SCOPE: process.env.AUTH0_SCOPE,
REDIRECT_URI:
process.env.REDIRECT_URI || 'http://localhost:3000/api/callback',
POST_LOGOUT_REDIRECT_URI:
process.env.POST_LOGOUT_REDIRECT_URI || 'http://localhost:3000',
SESSION_COOKIE_SECRET: process.env.SESSION_COOKIE_SECRET,
SESSION_COOKIE_DOMAIN: process.env.SESSION_COOKIE_DOMAIN,
SESSION_COOKIE_LIFETIME: 7200,
CURRENT_EVENT_ID: process.env.CURRENT_EVENT_ID,
},
...sourceMaps,
generateBuildId,
};