// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     <https://www.apache.org/licenses/LICENSE-2.0>
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

const fs = require("fs");
const path = require("path");

module.exports = fs
  .readdirSync("src")
  .filter(filename => filename.endsWith(".js"))
  .map(filename => ({
    context: path.resolve("src"),
    entry: `./${filename}`,
    output: {
      filename,
      path: path.resolve("dist")
    },
    optimization: {
      minimize: false
    }
  }));

@@ -639,16 +639,52 @@
 %22path%22);
+%0Aconst webpack = require(%22webpack%22);
 %0A%0Amodule
@@ -968,16 +968,283 @@
 se%0A    %7D
+,%0A    plugins: %5B%0A      new webpack.BannerPlugin(%7B%0A        banner:%0A          %22// Required for JavaScript engine shells.%5Cn%22 +%0A          %22if (typeof console === 'undefined') %7B%5Cn%22 +%0A          %22  console = %7Blog: print%7D;%5Cn%22 +%0A          %22%7D%22,%0A        raw: true%0A      %7D)%0A    %5D
 %0A  %7D));%0A

Support older JavaScript engine shells.