1
0

webpack.common.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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: /davclient/,
  20. use: 'exports-loader?dav'
  21. },
  22. {
  23. test: /\.js$/,
  24. loader: 'babel-loader',
  25. exclude: /node_modules/
  26. },
  27. {
  28. test: /\.(png|jpg|gif)$/,
  29. loader: 'url-loader',
  30. options: {
  31. name: '[name].[ext]?[hash]',
  32. limit: 8192
  33. }
  34. }
  35. ]
  36. },
  37. plugins: [
  38. new webpack.ProvidePlugin({
  39. '_': "underscore",
  40. $: "jquery",
  41. jQuery: "jquery"
  42. })
  43. ],
  44. resolve: {
  45. alias: {
  46. handlebars: 'handlebars/runtime'
  47. },
  48. extensions: ['*', '.js'],
  49. symlinks: false
  50. }
  51. },
  52. {
  53. entry: {
  54. share_backend: path.resolve(__dirname, 'js/merged-share-backend.js')
  55. },
  56. output: {
  57. filename: '[name].js',
  58. path: path.resolve(__dirname, 'js/dist')
  59. },
  60. module: {
  61. rules: [
  62. {
  63. test: /\.js$/,
  64. loader: 'babel-loader',
  65. exclude: /node_modules/
  66. }
  67. ]
  68. }
  69. }
  70. ];