webpack.config.js 1007 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const path = require("path");
  2. const webpack = require("webpack");
  3. const moduleName = "TaipyGuiBase";
  4. module.exports = {
  5. target: "web",
  6. entry: "./base/src/index.ts",
  7. output: {
  8. filename: "taipy-gui-base.js",
  9. path: path.resolve(__dirname, "dist"),
  10. globalObject: "this",
  11. library: {
  12. name: moduleName,
  13. type: "umd",
  14. },
  15. },
  16. plugins: [
  17. new webpack.optimize.LimitChunkCountPlugin({
  18. maxChunks: 1,
  19. }),
  20. ],
  21. module: {
  22. rules: [
  23. {
  24. test: /\.tsx?$/,
  25. use: "ts-loader",
  26. exclude: /node_modules/,
  27. },
  28. ],
  29. },
  30. resolve: {
  31. extensions: [".tsx", ".ts", ".js", ".tsx"],
  32. },
  33. // externals: {
  34. // "socket.io-client": {
  35. // commonjs: "socket.io-client",
  36. // commonjs2: "socket.io-client",
  37. // amd: "socket.io-client",
  38. // root: "_",
  39. // },
  40. // },
  41. };