// Lazy-loaded modules are assumed on the hosting domain,
// so we override the constant at runtime.
// __webpack_public_path__ = process.env.NODE_ENV === "production"
//   ? "https://example.com"
//   : "http://localhost:3000";

import { camelCase } from "lodash";

(async () => {
  // For minority of browers, bring in heavier polyfills.
  if (!Object.assign || !Array.from || !window.location.origin) {
    await import("../polyfills");
  }

  // Iterable list of widget scripts
  const containers = [...document.querySelectorAll("[data-my-widget]")];

  for (const container of containers) {
    const options = [...container.attributes]
      .filter(({ name }) => /^data-/.test(name))
      .reduce((acc, attribute) => {
        const { name, value } = attribute;
        const prop = camelCase(name.replace(/^data-(.+$)/, "$1"));

        return {
          ...acc,
          [prop]: value
        };
      }, {});

    const { myWidget, ...props } = options;

    // Attempt to import widget init script, or throw exception
    const render = await (async () => {
      try {
        const imported = await import(`./${myWidget}.js`);

        // `import`ed code-split modules contain all exports
        return imported.default;
      } catch (e) {
        // Friendly error message for invalid widget names
        if (e.message.match("Cannot find module")) {
          throw new Error(`Unknown data-my-widget: ${myWidget}`);
        } else {
          throw e;
        }
      }
    })();

    render(props, container);
  }
})();

@@ -1,234 +1,4 @@
-// Lazy-loaded modules are assumed on the hosting domain,%0A// so we override the constant at runtime.%0A// __webpack_public_path__ = process.env.NODE_ENV === %22production%22%0A//   ? %22https://example.com%22%0A//   : %22http://localhost:3000%22;%0A%0A
 impo

Remove __webpack_public_path__ for a "gotcha"