refactor(client): move to Vite by @phillipthelen

This commit is contained in:
Kalista Payne
2025-06-11 19:20:11 -05:00
parent 20d31ed8c8
commit ccc6c9867f
311 changed files with 5321 additions and 10626 deletions

View File

@@ -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;
}