build.js
async function buildConfig(file) {
  const { default: config } = await import(`${CONFIGS_PATH}/${file}`);
  const { creator, name, packageName } = config;

  creator
    .then((data) => {
      const stringifiedData = JSON.stringify(data);
      const generatedData = TEMPLATE.replace(/{{ data }}/, stringifiedData);
      const packageFile = path.resolve(PACKAGES_PATH, packageName, 'index.js');
      fs.writeFileSync(packageFile, generatedData);
    })
    .then(
      () => console.log(`Finished building ${name} config to ./packages/${packageName}`),
      error => console.log(error),
    );
}
async function buildConfig(file) {
  const { default: config } = await import(`${CONFIGS_PATH}/${file}`);
  const { creator, name, packageName } = config;

  creator
    .then((data) => {
      const stringifiedData = JSON.stringify(data);
      const generatedData = TEMPLATE.replace(/{{ data }}/, stringifiedData);
      const packageFile = path.resolve(PACKAGES_PATH, packageName, 'index.js');
      fs.writeFileSync(packageFile, generatedData);
    })
    .then(
      () => console.log(`Finished building ${name} config to ./packages/${packageName}`),
      error => console.log(error),
    );
}
async function buildConfig ( file ) { const { default : config } = await import ( ` ${ CONFIGS_PATH } ${ file } ` ) ; const { creator , name , packageName } = config ; creator . then ( ( data ) => { const stringifiedData = JSON . stringify ( data ) ; const generatedData = TEMPLATE . replace ( / {{ data }} / , stringifiedData ) ; const packageFile = path . resolve ( PACKAGES_PATH , packageName , 'index.js' ) ; fs . writeFileSync ( packageFile , generatedData ) ; } ) . then ( ( ) => console . log ( ` ${ name } ${ packageName } ` ) , error => console . log ( error ) , ) ; }
Builds config file to packages folder

@param {string} file - Config file
Builds config file to packages folder