webpack.common.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Licensed Materials - Property of IBM
  3. * IBM Cognos Products: BI (C) Copyright IBM Corp. 2019
  4. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. */
  6. const path = require("path");
  7. const config = {
  8. bail: true,
  9. entry: {
  10. "glass.webpack.bundle": [
  11. path.resolve(__dirname, "../src/js/baglass/react/index.js")
  12. ]
  13. },
  14. output: {
  15. libraryTarget: "umd",
  16. path: path.resolve(__dirname, "../js/baglass"),
  17. filename: "[name].js",
  18. sourceMapFilename: "[name].js.map",
  19. publicPath: "/bi/js/glass/baglass/js/baglass/app/"
  20. },
  21. externals: [{
  22. "i18n!": "i18n!",
  23. react: "react",
  24. "react-dom": "react-dom",
  25. mobx: "mobx",
  26. "mobx-react": "mobx-react",
  27. "mobx-state-tree": "mobx-state-tree",
  28. jquery: "jquery",
  29. "ca-ui-toolkit-core": "ca-ui-toolkit-core",
  30. underscore: "underscore",
  31. "prop-types": "prop-types"
  32. },
  33. /^baglass\/(.)+/
  34. ],
  35. module: {
  36. rules: [{
  37. test: /(\.jsx|\.js)$/,
  38. loader: "babel-loader",
  39. options: {
  40. filename: "glass.webpack.bundle",
  41. babelrc: true,
  42. babelrcRoots: [".."]
  43. },
  44. exclude: [/node_modules/]
  45. }]
  46. },
  47. resolve: {
  48. extensions: [".js", ".jsx", ".ts", ".tsx"],
  49. alias: {
  50. "webpackedGlass": path.resolve(__dirname, "../src/js/baglass/react")
  51. }
  52. }
  53. };
  54. module.exports = config;