You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

webpack.config.babel.js 1.9KB

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