Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* global __dirname */
  2. const child_process = require('child_process'); // eslint-disable-line camelcase
  3. const process = require('process');
  4. const webpack = require('webpack');
  5. const minimize
  6. = process.argv.indexOf('-p') !== -1
  7. || process.argv.indexOf('--optimize-minimize') !== -1;
  8. const plugins = [
  9. new webpack.LoaderOptionsPlugin({
  10. debug: !minimize,
  11. minimize
  12. })
  13. ];
  14. if (minimize) {
  15. plugins.push(new webpack.optimize.ModuleConcatenationPlugin());
  16. plugins.push(new webpack.optimize.UglifyJsPlugin({
  17. compress: {
  18. warnings: true
  19. },
  20. extractComments: true,
  21. sourceMap: true
  22. }));
  23. }
  24. module.exports = {
  25. devtool: 'source-map',
  26. entry: {
  27. 'lib-jitsi-meet': './index.js'
  28. },
  29. module: {
  30. rules: [ {
  31. // Version this build of the lib-jitsi-meet library.
  32. loader: 'string-replace-loader',
  33. options: {
  34. flags: 'g',
  35. replace:
  36. child_process.execSync( // eslint-disable-line camelcase
  37. `${__dirname}/get-version.sh`)
  38. // The type of the return value of
  39. // child_process.execSync is either Buffer or String.
  40. .toString()
  41. // Shells may automatically append CR and/or LF
  42. // characters to the output.
  43. .trim(),
  44. search: '{#COMMIT_HASH#}'
  45. },
  46. test: `${__dirname}/JitsiMeetJS.js`
  47. }, {
  48. // Transpile ES2015 (aka ES6) to ES5.
  49. exclude: [
  50. `${__dirname}/modules/RTC/adapter.screenshare.js`,
  51. `${__dirname}/node_modules/`
  52. ],
  53. loader: 'babel-loader',
  54. options: {
  55. presets: [
  56. [
  57. 'es2015',
  58. // Tell babel to avoid compiling imports into CommonJS
  59. // so that webpack may do tree shaking.
  60. { modules: false }
  61. ],
  62. 'stage-1'
  63. ]
  64. },
  65. test: /\.js$/
  66. } ]
  67. },
  68. node: {
  69. // Allow the use of the real filename of the module being executed. By
  70. // default Webpack does not leak path-related information and provides a
  71. // value that is a mock (/index.js).
  72. __filename: true
  73. },
  74. output: {
  75. filename: `[name]${minimize ? '.min' : ''}.js`,
  76. library: 'JitsiMeetJS',
  77. libraryTarget: 'umd',
  78. sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map`
  79. },
  80. plugins
  81. };