-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
29 lines (25 loc) · 977 Bytes
/
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
/** @type {import('next').NextConfig} */
const { runQueue } = require('./src/services/queue');
const { i18n } = require('./next-i18next.config');
const { cronJob } = require('./src/services/crons');
const { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_SERVER } = require('next/constants');
const isProduction = process.env.NEXT_PUBLIC_BUILD_ENV === 'production';
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
i18n,
};
module.exports = async (phase, { defaultConfig }) => {
console.log('Quickshare is starting...', phase);
let shouldRunQueue = phase === PHASE_DEVELOPMENT_SERVER || phase === PHASE_PRODUCTION_SERVER;
// if (!isProduction) shouldRunQueue = false;
if (process.env.NEXT_PUBLIC_SHORT_DOMAIN === 'true') shouldRunQueue = false;
if (shouldRunQueue) {
// runQueue()
}
let shouldRunCron = phase === PHASE_DEVELOPMENT_SERVER || phase === PHASE_PRODUCTION_SERVER;
if (shouldRunCron) {
cronJob();
}
return nextConfig;
};