-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
56 lines (50 loc) · 8.13 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
"use strict";
var _bundleAnalyzer = _interopRequireDefault(require("@next/bundle-analyzer"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
require('./src/dev-utils').populateEnv();
const paths = {
universe: `${__dirname}/src/`,
multiverse: `${__dirname}/lib/`
};
module.exports = () => {
return (0, _bundleAnalyzer.default)({
enabled: process.env.ANALYZE === 'true'
})({
distDir: 'build',
webpack: config => {
config.resolve && (config.resolve.alias = { ...config.resolve.alias,
universe: paths.universe,
multiverse: paths.multiverse
});
return config;
},
env: {
MAX_LIMIT: process.env.MAX_LIMIT,
IGNORE_RATE_LIMITS: process.env.IGNORE_RATE_LIMITS,
LOCKOUT_ALL_KEYS: process.env.LOCKOUT_ALL_KEYS,
DISALLOWED_METHODS: process.env.DISALLOWED_METHODS,
REQUESTS_PER_CONTRIVED_ERROR: process.env.REQUESTS_PER_CONTRIVED_ERROR,
MAX_OPTIONS_PER_ELECTION: process.env.MAX_OPTIONS_PER_ELECTION,
MAX_RANKINGS_PER_ELECTION: process.env.MAX_RANKINGS_PER_ELECTION,
MAX_CONTENT_LENGTH_BYTES: process.env.MAX_CONTENT_LENGTH_BYTES
},
experimental: {
async rewrites() {
return [{
source: '/v1/meta',
destination: '/api/v1/meta'
}, {
source: '/v1/elections',
destination: '/api/v1/elections'
}, {
source: '/v1/election/:id',
destination: '/api/v1/election/:id'
}, {
source: '/v1/election/:id/voters',
destination: '/api/v1/election/:id/voters'
}];
}
}
});
};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbmZpZy9uZXh0LmNvbmZpZy50cyJdLCJuYW1l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dXQgb2YgZXhwZXJpbWVudGFsIHdoZW4gdGhleSdyZSBub3QgZXhwZXJpbWVudGFsXG4gICAgICAgIC8vIFRPRE86IGFueW1vcmUhXG4gICAgICAgIGV4cGVyaW1lbnRhbDoge1xuICAgICAgICAgICAgYXN5bmMgcmV3cml0ZXMoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlOiAnL3YxL21ldGEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzdGluYXRpb246ICcvYXBpL3YxL21ldGEnXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZTogJy92MS9lbGVjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzdGluYXRpb246ICcvYXBpL3YxL2VsZWN0aW9ucydcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlOiAnL3YxL2VsZWN0aW9uLzppZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXN0aW5hdGlvbjogJy9hcGkvdjEvZWxlY3Rpb24vOmlkJ1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6ICcvdjEvZWxlY3Rpb24vOmlkL3ZvdGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXN0aW5hdGlvbjogJy9hcGkvdjEvZWxlY3Rpb24vOmlkL3ZvdGVycydcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9KTtcbn07XG4iXX0=