webpack.common.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. const path = require('path');
  2. const merge = require('webpack-merge');
  3. const { VueLoaderPlugin } = require('vue-loader');
  4. const core = require('./core/webpack');
  5. const settings = require('./settings/webpack');
  6. const accessibility = require('./apps/accessibility/webpack');
  7. const comments = require('./apps/comments/webpack');
  8. const files_sharing = require('./apps/files_sharing/webpack');
  9. const files_trashbin = require('./apps/files_trashbin/webpack');
  10. const files_versions = require('./apps/files_versions/webpack');
  11. const oauth2 = require('./apps/oauth2/webpack');
  12. const systemtags = require('./apps/systemtags/webpack');
  13. const twofactor_backupscodes = require('./apps/twofactor_backupcodes/webpack');
  14. const updatenotifications = require('./apps/updatenotification/webpack');
  15. const workflowengine = require('./apps/workflowengine/webpack');
  16. module.exports = []
  17. .concat(
  18. core,
  19. settings,
  20. accessibility,
  21. comments,
  22. files_sharing,
  23. files_trashbin,
  24. files_versions,
  25. oauth2,
  26. systemtags,
  27. twofactor_backupscodes,
  28. updatenotifications,
  29. workflowengine
  30. )
  31. .map(config =>
  32. merge.smart({
  33. module: {
  34. rules: [
  35. {
  36. test: /\.css$/,
  37. use: ['style-loader', 'css-loader']
  38. },
  39. {
  40. test: /\.scss$/,
  41. use: ['style-loader', 'css-loader', 'sass-loader']
  42. },
  43. {
  44. test: /\.js$/,
  45. loader: 'babel-loader',
  46. exclude: /node_modules/
  47. },
  48. {
  49. test: /\.vue$/,
  50. loader: 'vue-loader'
  51. },
  52. {
  53. test: /\.(png|jpg|gif)$/,
  54. loader: 'url-loader',
  55. options: {
  56. name: '[name].[ext]?[hash]',
  57. limit: 8192
  58. }
  59. },
  60. {
  61. test: /\.handlebars/,
  62. loader: "handlebars-loader",
  63. query: {
  64. extensions: '.handlebars'
  65. }
  66. }
  67. ]
  68. },
  69. plugins: [
  70. new VueLoaderPlugin()
  71. ],
  72. resolve: {
  73. alias: {
  74. OC: path.resolve(__dirname, './core/src/OC'),
  75. OCA: path.resolve(__dirname, './core/src/OCA'),
  76. // make sure to use the handlebar runtime when importing
  77. handlebars: 'handlebars/runtime'
  78. },
  79. extensions: ['*', '.js', '.vue', '.json']
  80. }
  81. }, config)
  82. );