webpack.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. const path = require('path')
  2. const webpack = require('webpack')
  3. module.exports = [
  4. {
  5. entry: {
  6. files_client: path.join(__dirname, 'src/files/client.js'),
  7. files_fileinfo: path.join(__dirname, 'src/files/fileinfo.js'),
  8. files_iedavclient: path.join(__dirname, 'src/files/iedavclient.js'),
  9. install: path.join(__dirname, 'src/install.js'),
  10. login: path.join(__dirname, 'src/login.js'),
  11. main: path.join(__dirname, 'src/main.js'),
  12. maintenance: path.join(__dirname, 'src/maintenance.js'),
  13. recommendedapps: path.join(__dirname, 'src/recommendedapps.js'),
  14. 'unified-search': path.join(__dirname, 'src/unified-search.js'),
  15. },
  16. output: {
  17. filename: '[name].js',
  18. path: path.resolve(__dirname, 'js/dist'),
  19. jsonpFunction: 'webpackJsonpCore',
  20. },
  21. module: {
  22. rules: [
  23. {
  24. test: /davclient/,
  25. loader: 'exports-loader',
  26. options: {
  27. type: 'commonjs',
  28. exports: 'dav',
  29. },
  30. },
  31. ],
  32. },
  33. plugins: [
  34. new webpack.ProvidePlugin({
  35. '_': 'underscore',
  36. $: 'jquery',
  37. jQuery: 'jquery',
  38. }),
  39. ],
  40. },
  41. {
  42. entry: {
  43. systemtags: path.resolve(__dirname, 'src/systemtags/merged-systemtags.js'),
  44. },
  45. output: {
  46. filename: '[name].js',
  47. path: path.resolve(__dirname, 'js/dist'),
  48. },
  49. },
  50. ]