webpack.config.js 643 B

12345678910111213141516171819202122232425
  1. const path = require("path");
  2. const variants = [
  3. { name: "web", libtype: "amd", target: "web" },
  4. { name: "node", libtype: "amd", target: "node" },
  5. { name: "oldstyle", libtype: "umd", target: "web" },
  6. ];
  7. module.exports = variants.map((variant) => {
  8. const obj = {
  9. name: variant.name,
  10. mode: "production",
  11. entry: "./radiomanifest.js",
  12. target: [variant.target],
  13. output: {
  14. path: path.resolve(__dirname, "dist"),
  15. filename: "radiomanifest-" + variant.name + ".bundle.js",
  16. clean: false,
  17. library: {
  18. name: "radiomanifest",
  19. type: variant.libtype,
  20. },
  21. },
  22. };
  23. return obj;
  24. });