mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
refactor(client): move to Vite by @phillipthelen
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
/* eslint-disable import/no-commonjs */
|
||||
// NOTE es5 requires/exports to allow import from webpack
|
||||
const nconfDefault = require('nconf');
|
||||
const { join, resolve } = require('path');
|
||||
import nconfDefault from 'nconf';
|
||||
import { join, resolve } from 'path';
|
||||
|
||||
const PATH_TO_CONFIG = join(resolve(__dirname, '../../../config.json'));
|
||||
|
||||
module.exports = function setupNconf (file, nconfInstance = nconfDefault) {
|
||||
export default function setupNconf (file, nconfInstance = nconfDefault) {
|
||||
const configFile = file || PATH_TO_CONFIG;
|
||||
|
||||
nconfInstance
|
||||
@@ -16,4 +16,7 @@ module.exports = function setupNconf (file, nconfInstance = nconfDefault) {
|
||||
nconfInstance.set('IS_PROD', nconfInstance.get('NODE_ENV') === 'production');
|
||||
nconfInstance.set('IS_DEV', nconfInstance.get('NODE_ENV') === 'development');
|
||||
nconfInstance.set('IS_TEST', nconfInstance.get('NODE_ENV') === 'test');
|
||||
};
|
||||
|
||||
// we need this in common and can't use nconf on the client.
|
||||
process.env.CONTENT_SWITCHOVER_TIME_OFFSET = nconfInstance.get('CONTENT_SWITCHOVER_TIME_OFFSET') || 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user