webpack.config.js 1.1 KB

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