umd.rollup.config.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * Rollup configuration for packaging the plugin in a module that is consumable
  3. * as the `src` of a `script` tag or via AMD or similar client-side loading.
  4. *
  5. * This module DOES include its dependencies.
  6. */
  7. import babel from 'rollup-plugin-babel';
  8. import commonjs from 'rollup-plugin-commonjs';
  9. import json from 'rollup-plugin-json';
  10. import resolve from 'rollup-plugin-node-resolve';
  11. export default {
  12. entry: 'src/plugin.js',
  13. output: {
  14. file: 'dist/videojs-flash.js',
  15. format: 'umd',
  16. name: 'videojsFlash',
  17. globals: {
  18. 'video.js': 'videojs'
  19. }
  20. },
  21. external: ['video.js'],
  22. legacy: true,
  23. plugins: [
  24. resolve({
  25. browser: true,
  26. main: true,
  27. jsnext: true
  28. }),
  29. json(),
  30. commonjs({
  31. sourceMap: false
  32. }),
  33. babel({
  34. babelrc: false,
  35. exclude: 'node_modules/**',
  36. presets: [
  37. 'es3',
  38. ['es2015', {
  39. loose: true,
  40. modules: false
  41. }]
  42. ],
  43. plugins: [
  44. 'external-helpers',
  45. 'transform-object-assign'
  46. ]
  47. })
  48. ]
  49. };