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.

87 lines
2.4 KiB

  1. const path = require('path')
  2. const { VueLoaderPlugin } = require('vue-loader')
  3. const StyleLintPlugin = require('stylelint-webpack-plugin')
  4. module.exports = {
  5. entry: {
  6. 'admin-settings': path.join(__dirname, 'src', 'mainAdminSettings.js'),
  7. 'collections': path.join(__dirname, 'src', 'collections.js'),
  8. 'talk': path.join(__dirname, 'src', 'main.js'),
  9. 'talk-files-sidebar': path.join(__dirname, 'src', 'mainFilesSidebar.js'),
  10. 'talk-files-sidebar-loader': path.join(__dirname, 'src', 'mainFilesSidebarLoader.js'),
  11. 'talk-public-share-auth-sidebar': path.join(__dirname, 'src', 'mainPublicShareAuthSidebar.js'),
  12. 'talk-public-share-sidebar': path.join(__dirname, 'src', 'mainPublicShareSidebar.js'),
  13. 'flow': path.join(__dirname, 'src', 'flow.js'),
  14. },
  15. output: {
  16. path: path.resolve(__dirname, './js'),
  17. publicPath: '/js/',
  18. filename: '[name].js',
  19. },
  20. module: {
  21. rules: [
  22. {
  23. test: /\.css$/,
  24. use: ['vue-style-loader', 'css-loader'],
  25. },
  26. {
  27. test: /\.scss$/,
  28. use: ['vue-style-loader', 'css-loader', 'sass-loader'],
  29. },
  30. {
  31. test: /\.(js|vue)$/,
  32. use: 'eslint-loader',
  33. exclude: /node_modules/,
  34. enforce: 'pre',
  35. },
  36. {
  37. test: /\.vue$/,
  38. loader: 'vue-loader',
  39. exclude: /node_modules(?!(\/|\\)(vue-material-design-icons)(\/|\\))/,
  40. },
  41. {
  42. test: /\.js$/,
  43. loader: 'babel-loader',
  44. exclude: /node_modules(?!(\/|\\)(@juliushaertl\/vue-richtext|fast-xml-parser|hot-patcher|nextcloud-vue-collections|webdav)(\/|\\))/,
  45. },
  46. {
  47. /**
  48. * webrtc-adapter main module does no longer provide
  49. * "module.exports", which is expected by some elements using it
  50. * (like "attachmediastream"), so it needs to be added back with
  51. * a plugin.
  52. */
  53. test: /node_modules\/webrtc-adapter\/.*\.js$/,
  54. loader: 'babel-loader',
  55. options: {
  56. plugins: ['add-module-exports'],
  57. presets: [
  58. /**
  59. * From "add-module-exports" documentation:
  60. * "webpack doesn't perform commonjs transformation for
  61. * codesplitting. Need to set commonjs conversion."
  62. */
  63. ['@babel/env', { modules: 'commonjs' }],
  64. ],
  65. },
  66. },
  67. {
  68. test: /\.(png|jpg|gif|svg)$/,
  69. loader: 'file-loader',
  70. options: {
  71. name: '[name].[ext]?[hash]',
  72. },
  73. },
  74. ],
  75. },
  76. plugins: [
  77. new VueLoaderPlugin(),
  78. new StyleLintPlugin({
  79. files: ['**/*.vue'],
  80. }),
  81. ],
  82. resolve: {
  83. extensions: ['*', '.js', '.vue'],
  84. symlinks: false,
  85. },
  86. }