src/core.js
/**
 * Sets user configurations
 * @param {object} options User defined configurations
 */
Sets user configurations
@param {object} options User defined configurations
Sets user configurations @param { object } options User defined configurations
function config(options = {}, configCwd = '') {
  if (!options) throw Error('Options must be a valid object');
  globalConfig.cwd = options.cwd ?? (configCwd || globalConfig.cwd);
  globalConfig.output = concatObjects(globalConfig.output, options.output ?? {});
  globalConfig.views = concatObjects(globalConfig.views, options.views ?? {});
  globalConfig.views.path = path.join(globalConfig.cwd, globalConfig.views.path);
  globalConfig.output.path = path.join(configCwd, globalConfig.output.path);
  globalConfig.plugins = concatObjects(globalConfig.plugins, options.plugins ?? {});
  globalConfig.site = concatObjects(globalConfig.site, options.site ?? {});
  globalConfig.asssets = concatObjects(globalConfig.assets, options.assets ?? {});
  globalConfig.build = concatObjects(globalConfig.build, options.build ?? {});
  globalLocales = options.locales ?? [];
  const validMode = [JESSE_BUILD_MODE_LAZY, JESSE_BUILD_MODE_BUSY, JESSE_BUILD_MODE_STRICT]
    .includes(globalConfig.build.mode);
  if (!validMode) throw Error('build mode is not valid');
}
function config ( options = { } , configCwd = '' ) { if ( ! options ) throw Error ( 'Options must be a valid object' ) ; globalConfig . cwd = options . cwd ?? ( configCwd || globalConfig . cwd ) ; globalConfig . output = concatObjects ( globalConfig . output , options . output ?? { } ) ; globalConfig . views = concatObjects ( globalConfig . views , options . views ?? { } ) ; globalConfig . views . path = path . join ( globalConfig . cwd , globalConfig . views . path ) ; globalConfig . output . path = path . join ( configCwd , globalConfig . output . path ) ; globalConfig . plugins = concatObjects ( globalConfig . plugins , options . plugins ?? { } ) ; globalConfig . site = concatObjects ( globalConfig . site , options . site ?? { } ) ; globalConfig . asssets = concatObjects ( globalConfig . assets , options . assets ?? { } ) ; globalConfig . build = concatObjects ( globalConfig . build , options . build ?? { } ) ; globalLocales = options . locales ?? [ ] ; const validMode = [ JESSE_BUILD_MODE_LAZY , JESSE_BUILD_MODE_BUSY , JESSE_BUILD_MODE_STRICT ] . includes ( globalConfig . build . mode ) ; if ( ! validMode ) throw Error ( 'build mode is not valid' ) ; }
Sets user configurations
 @param {object} options User defined configurations
Sets user configurations @param { object } options User defined configurations
// update paths // update using user configs