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.

65 lines
1.8 KiB

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