webconfig.js
/*
 * Reads given config template and replaces any required strings
 */
Reads given config template and replaces any required strings
Reads given config template and replaces any required strings
function resolveConfig(cfg, src, mimecb) {
  const mimes = mimecb(cfg.mime);
  let tpl = fs.readFileSync(src).toString();
  tpl = tpl.replace(/%DISTDIR%/, path.join(ROOT, 'dist'));
  tpl = tpl.replace(/%MIMES%/, mimes);
  tpl = tpl.replace(/%PORT%/, cfg.server.http.port);
  return tpl;
}
function resolveConfig ( cfg , src , mimecb ) { const mimes = mimecb ( cfg . mime ) ; let tpl = fs . readFileSync ( src ) . toString ( ) ; tpl = tpl . replace ( / %DISTDIR% / , path . join ( ROOT , 'dist' ) ) ; tpl = tpl . replace ( / %MIMES% / , mimes ) ; tpl = tpl . replace ( / %PORT% / , cfg . server . http . port ) ; return tpl ; }
Reads given config template and replaces any required strings
Reads given config template and replaces any required strings