Sparrow is a libre front-end forum software powered by the Matrix protocol and using a Matrix homeserver as its back-end

webpack.config.js 860B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. const path = require('path');
  2. const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
  3. const HtmlWebpackPlugin = require('html-webpack-plugin');
  4. const CopyWebpackPlugin = require('copy-webpack-plugin');
  5. module.exports = {
  6. entry: ['babel-polyfill', './src/index.js'],
  7. devtool: 'source-map',
  8. module: {
  9. rules: [
  10. {
  11. test: /\.js$/,
  12. exclude: /node_modules/,
  13. use: {
  14. loader: 'babel-loader',
  15. options: {
  16. presets: ['env', 'flow']
  17. }
  18. }
  19. }
  20. ]
  21. },
  22. output: {
  23. filename: 'sparrow.js',
  24. path: path.resolve(__dirname, 'dist')
  25. },
  26. externals: {
  27. "matrix-js-sdk": "matrixcs"
  28. },
  29. plugins: [
  30. new UglifyJSPlugin(),
  31. new HtmlWebpackPlugin({template: './src/index.html'}),
  32. new CopyWebpackPlugin(
  33. [
  34. {
  35. from: path.resolve(__dirname, 'src', 'lib'),
  36. to: path.resolve(__dirname, 'dist', 'lib')
  37. }
  38. ]
  39. )
  40. ]
  41. };