webpack.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. const path = require('path');
  2. const webpack = require('webpack');
  3. module.exports = [
  4. {
  5. entry: {
  6. main: path.join(__dirname, 'src/main.js'),
  7. },
  8. output: {
  9. filename: '[name].js',
  10. path: path.resolve(__dirname, 'js/dist')
  11. },
  12. module: {
  13. rules: [
  14. {
  15. test: /\.css$/,
  16. use: ['style-loader', 'css-loader']
  17. },
  18. {
  19. test: /\.scss$/,
  20. use: ['style-loader', 'css-loader', 'sass-loader']
  21. },
  22. {
  23. test: /davclient/,
  24. use: 'exports-loader?dav'
  25. },
  26. {
  27. test: /\.js$/,
  28. loader: 'babel-loader',
  29. exclude: /node_modules/
  30. },
  31. {
  32. test: /\.(png|jpg|gif)$/,
  33. loader: 'url-loader',
  34. options: {
  35. name: '[name].[ext]?[hash]',
  36. limit: 8192
  37. }
  38. },
  39. {
  40. test: /\.handlebars/,
  41. loader: "handlebars-loader",
  42. query: {
  43. extensions: '.handlebars'
  44. }
  45. }
  46. ]
  47. },
  48. plugins: [
  49. new webpack.ProvidePlugin({
  50. '_': "underscore",
  51. $: "jquery",
  52. jQuery: "jquery"
  53. })
  54. ],
  55. resolve: {
  56. alias: {
  57. handlebars: 'handlebars/runtime'
  58. },
  59. extensions: ['*', '.js'],
  60. symlinks: false
  61. }
  62. },
  63. {
  64. entry: {
  65. share_backend: path.resolve(__dirname, 'js/merged-share-backend.js'),
  66. systemtags: path.resolve(__dirname, 'js/systemtags/merged-systemtags.js')
  67. },
  68. output: {
  69. filename: '[name].js',
  70. path: path.resolve(__dirname, 'js/dist')
  71. },
  72. module: {
  73. rules: [
  74. {
  75. test: /\.js$/,
  76. loader: 'babel-loader',
  77. exclude: /node_modules/
  78. },
  79. {
  80. test: /\.css$/,
  81. use: ['style-loader', 'css-loader']
  82. },
  83. {
  84. test: /\.scss$/,
  85. use: ['style-loader', 'css-loader', 'sass-loader']
  86. },
  87. ]
  88. }
  89. }
  90. ];