添加入口配置

@param {object} env
@param {object} webpackConfig
163729
function addEntries(env, webpackConfig) {
    // 指定入口的 js 文件和 html 文件的路径, 默认相对于 src 目录(根目录)
    wieldyWebpack.createEntry('index/index.js', 'index.html', {
        env: env,
        // 有多个入口时, 在创建时需要设置 setChunks 为 true
        setChunks: true
    }).addToWebpackConfig(webpackConfig);

    // 使用 layout 机制
    wieldyWebpack.createEntry('about/about.js', 'about/about.html', {
        title: 'wieldy-webpack 多入口示例项目 about',
        env: env,
        setChunks: true
    }).useLayout('layout.html', {
        env: {
            __body_start__: '<p>测试</p>'
        }
    }).addToWebpackConfig(webpackConfig);

    // 使用 layout 机制时可以不指定入口的 html 文件
    wieldyWebpack.createEntry('login/login.js', '', {
        title: 'wieldy-webpack 多入口示例项目 login',
        env: env,
        setChunks: true
    }).useLayout('layout.html', {
        env: {
            __body_start__: `
                <h1>登录</h1>
                <ul>
                    <li><a href="/index.html">首页</a></li>
                    <li><a href="/about/about.html">关于</a></li>
                    <li><a href="/login/login.html">登录</a></li>
                </ul>
            `
        }
    }).addToWebpackConfig(webpackConfig);
}
599323
function serve(argv, skyPagesConfig, webpack, WebpackDevServer) {

  const webpackConfig = require('../config/webpack/serve.webpack.config');
  let config = webpackConfig.getWebpackConfig(argv, skyPagesConfig);

  getPort(config, skyPagesConfig).then(port => {
    const localUrl = `https://localhost:${port}`;

    assetsProcessor.setSkyAssetsLoaderUrl(config, skyPagesConfig, localUrl);
    localeAssetsProcessor.prepareLocaleFiles();

    // Save our found or defined port
    config.devServer.port = port;

    /* istanbul ignore else */
    if (config.devServer.inline) {
      const inline = `webpack-dev-server/client?${localUrl}`;
      Object.keys(config.entry).forEach((entry) => {
        config.entry[entry].unshift(inline);
      });
    }

    if (config.devServer.hot) {
      const hot = `webpack/hot/only-dev-server`;
      Object.keys(config.entry).forEach((entry) => {
        config.entry[entry].unshift(hot);
      });

      // This is required in order to not have HMR requests routed to host.
      config.output.publicPath = `${localUrl}${config.devServer.publicPath}`;
      logger.info('Using hot module replacement.');
    }

    const compiler = webpack(config);
    const server = new WebpackDevServer(compiler, config.devServer);
    server.listen(config.devServer.port, 'localhost', (err) => {
      if (err) {
        logger.error(err);
      }
    });
  }).catch(err => logger.error(err));

}
257294
function initExpress(app) {
  var env = app.get('env');
  var publicDir = path.join(config.root, config.publicDir);

  app.set('ip', config.ip);
  app.set('port', config.port);

  app.set('views', config.root + '/server/views');
  app.engine('html', require('ejs').renderFile);
  app.set('view engine', 'html');

  app.use(compression());
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(bodyParser.json());
  app.use(methodOverride());
  app.use(cookieParser());
  app.use(passport.initialize());
  app.use(favicon(path.join(publicDir, 'favicon.ico')));

  if ('production' === env) {
    app.use(express.static(publicDir));
    app.set('appPath', publicDir);
    app.use(morgan('tiny'));
  }

  if ('development' === env || 'test' === env) {
    app.use(express.static(path.join(config.root, '.tmp')));
    app.use(express.static(publicDir));
    app.set('appPath', publicDir);
    app.use(morgan('dev'));
    // Error handler - has to be last
    app.use(errorHandler());
  }
}
420600
function setupHMR (webpackConfig, port) {
  return webpackConfig.map((webpack) => ({
    ...webpack,
    entry: concatHMRBundle(webpack.entry, port)
  }))
}
530993
function configFactory(filename, options) {
    if (!_.isObject(options)) {
        options = {};
    }

    var config = WebpackConfig.loader.loadConfig(filename),
        isArray = _.isArray(config);

    if (!isArray) {
        config = [config];
    }

    config = _.map(config, function(x) {
        x.merge(options);
        x.defaults({
            output: {
                path: path.dirname(filename)
            }
        });

        return x;
    });

    return isArray ? config : _.first(config);
}
1265344
function prepareServe() {

  if (webpackServer) {
    return bindServe();
  } else {
    return new Promise((resolve, reject) => {
      portfinder.getPortPromise()
        .then(writeConfigServe)
        .then(bindServe)
        .then(resolve)
        .catch(err => reject(err));
    });
  }
}
1150160
function hotCreateRequire(moduleId) { // eslint-disable-line no-unused-vars
/******/ 		var me = installedModules[moduleId];
/******/ 		if(!me) return __webpack_require__;
/******/ 		var fn = function(request) {
/******/ 			if(me.hot.active) {
/******/ 				if(installedModules[request]) {
/******/ 					if(installedModules[request].parents.indexOf(moduleId) < 0)
/******/ 						installedModules[request].parents.push(moduleId);
/******/ 					if(me.children.indexOf(request) < 0)
/******/ 						me.children.push(request);
/******/ 				} else hotCurrentParents = [moduleId];
/******/ 			} else {
/******/ 				console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
/******/ 				hotCurrentParents = [];
/******/ 			}
/******/ 			return __webpack_require__(request);
/******/ 		};
/******/ 		for(var name in __webpack_require__) {
/******/ 			if(Object.prototype.hasOwnProperty.call(__webpack_require__, name)) {
/******/ 				fn[name] = __webpack_require__[name];
/******/ 			}
/******/ 		}
/******/ 		fn.e = function(chunkId, callback) {
/******/ 			if(hotStatus === "ready")
/******/ 				hotSetStatus("prepare");
/******/ 			hotChunksLoading++;
/******/ 			__webpack_require__.e(chunkId, function() {
/******/ 				try {
/******/ 					callback.call(null, fn);
/******/ 				} finally {
/******/ 					finishChunkLoading();
/******/ 				}
/******/ 				function finishChunkLoading() {
/******/ 					hotChunksLoading--;
/******/ 					if(hotStatus === "prepare") {
/******/ 						if(!hotWaitingFilesMap[chunkId]) {
/******/ 							hotEnsureUpdateChunk(chunkId);
/******/ 						}
/******/ 						if(hotChunksLoading === 0 && hotWaitingFiles === 0) {
/******/ 							hotUpdateDownloaded();
/******/ 						}
/******/ 					}
/******/ 				}
/******/ 			});
/******/ 		};
/******/ 		return fn;
/******/ 	}
1129750
function startServer(devServerUrl) {
  const { port: devServerPort } = url.parse(devServerUrl);
  return choosePort(HOST, devServerPort - 1)
    .then(port => {
      if (port == null) {
        // We have not found a port.
        return;
      }
      const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
      const appName = require(paths.appPackageJson).name;
      const urls = prepareUrls(protocol, HOST, port);
      // Directly set the HOST, PORT and PROTOCOL, which would be used in DefinePlugin
      // let the webpack define the public path correctly in DefinePlugin
      process.env.HOST = HOST;
      process.env.PORT = port;
      process.env.PROTOCOL = protocol;
      process.env.PUBLIC_URL = url.format({ protocol: protocol, hostname: HOST, port: devServerPort });

      // Create a webpack compiler that is configured with custom messages.
      const webpackConfig = serverlize(paths, config, `${devServerUrl}/`);
      const compiler = createCompiler(webpack, webpackConfig, appName, urls, useYarn);
      let browserOpened = false;
      compiler.watch({
        quiet: true,
        stats: 'none'
      }, (err, stats) => {
        if (!browserOpened) {
          openBrowser(urls.localUrlForBrowser);
          browserOpened = true;
        }
        if (err) {
          console.log(chalk.red('Failed to compile.\n'));
          printBuildError(err);
          return;
        }
        if (isInteractive) {
          clearConsole();
        }
        const messages = formatWebpackMessages(stats.toJson({}, true));
        if (messages.errors.length) {
          // Only keep the first error. Others are often indicative
          // of the same problem, but confuse the reader with noise.
          if (messages.errors.length > 1) {
            messages.errors.length = 1;
          }
          console.log(chalk.red('Failed to compile.\n'));
          printBuildError(new Error(messages.errors.join('\n\n')));
          return;
        }
        console.log(chalk.green('Compiled successfully!'));
        console.log(
          `To create a production build, use ` +
            `${chalk.cyan(`${useYarn ? 'yarn' : 'npm run'} build:server`)}.`
        );
        console.log('Note that all client side errors or warnings are suppressed.');
        console.log();
      });
    })
    .catch(err => {
      if (err && err.message) {
        console.log(err.message);
      }
      process.exit(1);
    });
}
431348
function getWebpackConfig(config, context) {
  var webpackConfig = {
    module: {
      rules: [
        {
          exclude: /node_modules/,
          loader: assist.resolve('babel-loader'),
          test: /\.(es6|js)$/
        }
      ]
    },
    output: {
      path: config.$path.target.client,
      filename: '[name].js'
    },
    resolve: {
      extensions: ['.js'],
      alias: config.alias || {}
    },
    externals: {}
  }

  var babelConfig = assist.getBabelConfig(context.env)
  var babelLoader = webpackConfig.module.rules
    .find(rule => rule.loader && /babel/.test(rule.loader))
  babelLoader.options = babelConfig

  var processEnv = {
    'process.env': {
      NODE_ENV: JSON.stringify(context.env || 'production'),
      IS_BROWSER: true
    }
  }
  if (context.env === 'development') {
    // development env
    webpackConfig.plugins = [
      new webpack.DefinePlugin(processEnv)
    ]
  } else {
    // production env
    webpackConfig.plugins = [
      new webpack.DefinePlugin(processEnv),
      new webpack.optimize.CommonsChunkPlugin({ name: 'common' }),
      new webpack.optimize.UglifyJsPlugin({ sourceMap: false })
    ]
  }

  return webpackConfig
}
713595
function ENS (provider, address, Web3js) {
  if (Web3js !== undefined) {
    Web3 = Web3js;
  }
  if (!!/^0\./.exec(Web3.version || (new Web3(provider)).version.api)) {
    return utils.construct(ENS_0, [provider, address]);
  } else {
    return utils.construct(ENS_1, [provider, address]);
  }
}
508341
private void setPackages(DocEnv env, List<String> packages) {
        ListBuffer<PackageDocImpl> packlist = new ListBuffer<PackageDocImpl>();
        for (String name : packages) {
            PackageDocImpl pkg = env.lookupPackage(name);
            if (pkg != null) {
                pkg.isIncluded = true;
                packlist.append(pkg);
            } else {
                env.warning(null, "main.no_source_files_for_package", name);
            }
        }
        cmdLinePackages = packlist.toList();
    }
1226806
def call(env)
      req = Rack::Request.new(env)
      status, headers, response = @app.call(env)

      config = SecureHeaders.config_for(req)
      flag_cookies!(headers, override_secure(env, config.cookies)) unless config.cookies == OPT_OUT
      headers.merge!(SecureHeaders.header_hash_for(req))
      [status, headers, response]
    end
942049
function () {
    const oThis = this;

    // Add comment to ENV
    fileManager.append(setupConfig.env_vars_file, "\n# Addresses");

    for (var account in setupConfig.addresses) {
      oThis._scanAndPopulateEnvVars(setupConfig.addresses[account]);
    }
  }
1155277
function (err) {
                var responseOptions = new __WEBPACK_IMPORTED_MODULE_3__base_response_options__["b" /* ResponseOptions */]({
                    body: err,
                    type: __WEBPACK_IMPORTED_MODULE_4__enums__["d" /* ResponseType */].Error,
                    status: _xhr.status,
                    statusText: _xhr.statusText,
                });
                if (baseResponseOptions != null) {
                    responseOptions = baseResponseOptions.merge(responseOptions);
                }
                responseObserver.error(new __WEBPACK_IMPORTED_MODULE_8__static_response__["a" /* Response */](responseOptions));
            }
1039299
public void addEnv(final Environment.Variable env){
        if(null==envVars) {
            envVars = new ArrayList<Environment.Variable>();
        }
        envVars.add(env);
    }
563060
function(env, baseConfig) {
    percyConfig = baseConfig.percy || {};

    // Store the Ember rootURL to be used later.
    percyConfig.baseUrlPath = baseConfig.rootURL || '/';

    // Make sure the percy config has a 'breakpoints' object.
    percyConfig.breakpointsConfig = percyConfig.breakpointsConfig || {};
  }
959588
function (runtime, name, fn, config) {
            name = indexMapStr(name);

            var mods = runtime.Env.mods,
                mod = mods[name];

            if (mod && mod.fn) {
                S.log(name + ' is defined more than once', 'warn');
                return;
            }

            // 没有 use，静态载入的 add 可能执行
            Utils.createModuleInfo(runtime, name);

            mod = mods[name];

            // 注意：通过 S.add(name[, fn[, config]]) 注册的代码，无论是页面中的代码，
            // 还是 js 文件里的代码，add 执行时，都意味着该模块已经 LOADED
            S.mix(mod, {
                name: name,
                status: LOADED,
                fn: fn
            });

            S.mix(mod, config);
        }