您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

webpack.config.babel.js 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* global __dirname */
  2. import child_process from 'child_process'; // eslint-disable-line camelcase
  3. import path from 'path';
  4. import process from 'process';
  5. const minimize
  6. = process.argv.indexOf('-p') !== -1
  7. || process.argv.indexOf('--optimize-minimize') !== -1;
  8. export default {
  9. devtool: 'source-map',
  10. entry: {
  11. 'lib-jitsi-meet': './JitsiMeetJS.js'
  12. },
  13. module: {
  14. loaders: [ {
  15. // Version this build of the lib-jitsi-meet library.
  16. include: path.resolve(__dirname, './JitsiMeetJS.js'),
  17. loader: 'string-replace',
  18. query: {
  19. flags: 'g',
  20. replace:
  21. child_process.execSync( // eslint-disable-line camelcase
  22. path.resolve(__dirname, './get-version.sh'))
  23. // The type of the return value of
  24. // child_process.execSync is either Buffer or String.
  25. .toString()
  26. // Shells may automatically append CR and/or LF
  27. // characters to the output.
  28. .trim(),
  29. search: '{#COMMIT_HASH#}'
  30. },
  31. test: /\.js$/
  32. }, {
  33. // Transpile ES2015 (aka ES6) to ES5.
  34. exclude: [
  35. path.resolve(__dirname, './modules/RTC/adapter.screenshare.js'),
  36. path.resolve(__dirname, './node_modules/')
  37. ],
  38. loader: 'babel',
  39. test: /\.js$/
  40. } ]
  41. },
  42. node: {
  43. // Allow the use of the real filename of the module being executed. By
  44. // default Webpack does not leak path-related information and provides a
  45. // value that is a mock (/index.js).
  46. __filename: true
  47. },
  48. output: {
  49. filename: `[name]${minimize ? '.min' : ''}.js`,
  50. library: 'JitsiMeetJS',
  51. libraryTarget: 'umd',
  52. sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map`
  53. }
  54. };