You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.7 KiB

  1. const path = require('node:path')
  2. const { EsbuildPlugin } = require('esbuild-loader')
  3. const webpack = require('webpack')
  4. const { mergeWithRules } = require('webpack-merge')
  5. const nextcloudWebpackConfig = require('@nextcloud/webpack-vue-config')
  6. const commonWebpackConfig = require('./webpack.common.config.js')
  7. module.exports = mergeWithRules({
  8. module: {
  9. // Rules from @nextcloud/webpack-vue-config/rules already added by commonWebpackConfig
  10. rules: 'replace',
  11. },
  12. optimization: {
  13. minimizer: 'replace',
  14. },
  15. })(nextcloudWebpackConfig, commonWebpackConfig, {
  16. entry: {
  17. 'admin-settings': path.join(__dirname, 'src', 'mainAdminSettings.js'),
  18. collections: path.join(__dirname, 'src', 'collections.js'),
  19. main: path.join(__dirname, 'src', 'main.js'),
  20. recording: path.join(__dirname, 'src', 'mainRecording.js'),
  21. 'files-sidebar': [
  22. path.join(__dirname, 'src', 'mainFilesSidebar.js'),
  23. path.join(__dirname, 'src', 'mainFilesSidebarLoader.js'),
  24. ],
  25. 'public-share-auth-sidebar': path.join(__dirname, 'src', 'mainPublicShareAuthSidebar.js'),
  26. 'public-share-sidebar': path.join(__dirname, 'src', 'mainPublicShareSidebar.js'),
  27. flow: path.join(__dirname, 'src', 'flow.js'),
  28. dashboard: path.join(__dirname, 'src', 'dashboard.js'),
  29. deck: path.join(__dirname, 'src', 'deck.js'),
  30. maps: path.join(__dirname, 'src', 'maps.js'),
  31. },
  32. output: {
  33. assetModuleFilename: '[name][ext]?v=[contenthash]',
  34. },
  35. optimization: {
  36. splitChunks: {
  37. cacheGroups: {
  38. defaultVendors: {
  39. reuseExistingChunk: true,
  40. },
  41. },
  42. },
  43. minimizer: [
  44. new EsbuildPlugin({
  45. target: 'es2020',
  46. }),
  47. ],
  48. },
  49. plugins: [
  50. new webpack.DefinePlugin({ IS_DESKTOP: false }),
  51. ],
  52. cache: true,
  53. })