packages/build-tools/create-webpack-config.js
async function buildWebpackEntry() {
    const { components } = await getBoltManifest();
    const entry = {};
    const globalEntryName = 'bolt-global';

    if (components.global) {
      entry[globalEntryName] = [];

      components.global.forEach(component => {
        if (component.assets.style) {
          entry[globalEntryName].push(component.assets.style);
        }

        if (component.assets.main) {
          entry[globalEntryName].push(component.assets.main);
        }
      });

      const useHotMiddleware =
        Array.isArray(fullBuildConfig.lang) && fullBuildConfig.lang.length > 1
          ? false
          : true;

      if (!config.prod && config.webpackDevServer && useHotMiddleware) {
        entry[globalEntryName].push(
          `webpack-hot-middleware/client?name=${
            config.lang
          }&noInfo=true&quiet=true&logLevel=silent&reload=true`,
        );
      }
    }
    if (components.individual) {
      components.individual.forEach(component => {
        const files = [];
        if (component.assets.style) files.push(component.assets.style);
        if (component.assets.main) files.push(component.assets.main);
        if (files) {
          entry[component.basicName] = files;
        }
      });
    }
    if (config.verbosity > 4) {
      log.info('WebPack `entry`:');
      console.log(entry);
    }
    return entry;
  }
async function buildWebpackEntry() {
    const { components } = await getBoltManifest();
    const entry = {};
    const globalEntryName = 'bolt-global';

    if (components.global) {
      entry[globalEntryName] = [];

      components.global.forEach(component => {
        if (component.assets.style) {
          entry[globalEntryName].push(component.assets.style);
        }

        if (component.assets.main) {
          entry[globalEntryName].push(component.assets.main);
        }
      });

      const useHotMiddleware =
        Array.isArray(fullBuildConfig.lang) && fullBuildConfig.lang.length > 1
          ? false
          : true;

      if (!config.prod && config.webpackDevServer && useHotMiddleware) {
        entry[globalEntryName].push(
          `webpack-hot-middleware/client?name=${
            config.lang
          }&noInfo=true&quiet=true&logLevel=silent&reload=true`,
        );
      }
    }
    if (components.individual) {
      components.individual.forEach(component => {
        const files = [];
        if (component.assets.style) files.push(component.assets.style);
        if (component.assets.main) files.push(component.assets.main);
        if (files) {
          entry[component.basicName] = files;
        }
      });
    }
    if (config.verbosity > 4) {
      log.info('WebPack `entry`:');
      console.log(entry);
    }
    return entry;
  }
async function buildWebpackEntry ( ) { const { components } = await getBoltManifest ( ) ; const entry = { } ; const globalEntryName = 'bolt-global' ; if ( components . global ) { entry [ globalEntryName ] = [ ] ; components . global . forEach ( component => { if ( component . assets . style ) { entry [ globalEntryName ] . push ( component . assets . style ) ; } if ( component . assets . main ) { entry [ globalEntryName ] . push ( component . assets . main ) ; } } ) ; const useHotMiddleware = Array . isArray ( fullBuildConfig . lang ) && fullBuildConfig . lang . length > 1 ? false : true ; if ( ! config . prod && config . webpackDevServer && useHotMiddleware ) { entry [ globalEntryName ] . push ( ` ${ config . lang } ` , ) ; } } if ( components . individual ) { components . individual . forEach ( component => { const files = [ ] ; if ( component . assets . style ) files . push ( component . assets . style ) ; if ( component . assets . main ) files . push ( component . assets . main ) ; if ( files ) { entry [ component . basicName ] = files ; } } ) ; } if ( config . verbosity > 4 ) { log . info ( 'WebPack `entry`:' ) ; console . log ( entry ) ; } return entry ; }
Build WebPack config's `entry` object
@link https://webpack.js.org/configuration/entry-context/#entry
@returns {object} entry - WebPack config `entry`
Build WebPack config s entry object