rollup.config.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. const fs = require('fs')
  2. const PATH = `./.laser-lib-path`
  3. const buildPaths = [
  4. `build`,
  5. ...fs.existsSync(PATH) ? [fs.readFileSync(PATH).toString()] : []
  6. ]
  7. const builds = []
  8. for (const dir of buildPaths) {
  9. builds.push(
  10. ...[
  11. {
  12. input: 'src/Potree.js',
  13. treeshake: false,
  14. output: {
  15. file: `${dir}/potree/potree.js`,
  16. format: 'umd',
  17. name: 'Potree',
  18. sourcemap: true,
  19. }
  20. }, {
  21. input: 'src/workers/BinaryDecoderWorker.js',
  22. output: {
  23. file: `${dir}/potree/workers/BinaryDecoderWorker.js`,
  24. format: 'es',
  25. name: 'Potree',
  26. sourcemap: false
  27. }
  28. },{
  29. input: 'src/modules/loader/2.0/DecoderWorker.js',
  30. output: {
  31. file: `${dir}/potree/workers/2.0/DecoderWorker.js`,
  32. format: 'es',
  33. name: 'Potree',
  34. sourcemap: false
  35. }
  36. },{
  37. input: 'src/modules/loader/2.0/DecoderWorker_brotli.js',
  38. output: {
  39. file: `${dir}/potree/workers/2.0/DecoderWorker_brotli.js`,
  40. format: 'es',
  41. name: 'Potree',
  42. sourcemap: false
  43. }
  44. }
  45. ]
  46. )
  47. }
  48. export default builds