message: Add warning for default webpack config and dont use webpack config without specifying for sites
diff: @@ -159,17 +159,42 @@ fn setup_build(target: &Target) -> Result<(Command, PathBuf, Bundle), failure::E
  command.arg(format!("--wasm-binding={}", bundle.get_wasm_binding()));
  - let webpack_config_path = PathBuf::from(
  - &target
  - .webpack_config
  - .clone()
  - .unwrap_or_else(|| "webpack.config.js".to_string()),
  - );
  + let webpack_config_path = if let Some(webpack_config) = &target.webpack_config {
  + Some(PathBuf::from(webpack_config.clone()))
  + } else if target.site.is_none() {
  + message::warn("In Wrangler v1.6.0, you will need to include a webpack_config field in your wrangler.toml to build with a custom webpack configuration.");
  + Some(PathBuf::from("webpack.config.js".to_string()))
  + } else {
  + None
  + };
  // if {webpack.config.js} is not present, we infer the entry based on the
  // {package.json} file and pass it to {wranglerjs}.
  // https://github.com/cloudflare/wrangler/issues/98
  - if !bundle.has_webpack_config(&webpack_config_path) {
  + if let Some(webpack_config_path) = webpack_config_path {
  + if bundle.has_webpack_config(&webpack_config_path) {
  + build_with_custom_webpack(&mut command, &webpack_config_path);
  + } else {
  + build_with_default_webpack(&mut command, &build_dir)?;
  + }
  + } else {
  + build_with_default_webpack(&mut command, &build_dir)?;
  + }
  +
  + Ok((command, temp_file, bundle))
  +}
  +
  +fn build_with_custom_webpack(command: &mut Command, webpack_config_path: &PathBuf) {
  + command.arg(format!(
  + "--webpack-config={}",
  + &webpack_config_path.to_str().unwrap().to_string()
  + ));
  +}
  +
  +fn build_with_default_webpack(
  + command: &mut Command,
  + build_dir: &PathBuf,
  +) -> Result<(), failure::Error> {
  let package = Package::new(&build_dir)?;
  let package_main = build_dir
  .join(package.main(&build_dir)?)
  @@ -178,14 +203,7 @@ fn setup_build(target: &Target) -> Result<(Command, PathBuf, Bundle), failure::E
  .to_string();
  command.arg("--no-webpack-config=1");
  command.arg(format!("--use-entry={}", package_main));
  - } else {
  - command.arg(format!(
  - "--webpack-config={}",
  - &webpack_config_path.to_str().unwrap().to_string()
  - ));
  - }
  -
  - Ok((command, temp_file, bundle))
  + Ok(())
  }
  pub fn scaffold_site_worker(target: &Target) -> Result<(), failure::Error> {
  