rollup.config.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. const commonjs = require('@rollup/plugin-commonjs');
  2. const babel = require('@rollup/plugin-babel').default;
  3. const license = require('rollup-plugin-license');
  4. module.exports = [{
  5. input: 'src/marked.js',
  6. output: {
  7. file: 'lib/marked.umd.js',
  8. format: 'umd',
  9. name: 'marked'
  10. },
  11. plugins: [
  12. license({
  13. banner: `
  14. DO NOT EDIT THIS FILE
  15. The code in this file is generated from files in ./src/
  16. `
  17. }),
  18. license({
  19. banner: `
  20. marked - a markdown parser
  21. Copyright (c) 2011-${new Date().getFullYear()}, Christopher Jeffrey. (MIT Licensed)
  22. https://github.com/markedjs/marked
  23. `
  24. }),
  25. commonjs(),
  26. babel({
  27. presets: [['@babel/preset-env', { loose: true }]]
  28. })
  29. ]
  30. },
  31. {
  32. input: 'src/marked.js',
  33. output: {
  34. file: 'lib/marked.cjs',
  35. format: 'cjs',
  36. name: 'marked'
  37. },
  38. plugins: [
  39. license({
  40. banner: `
  41. DO NOT EDIT THIS FILE
  42. The code in this file is generated from files in ./src/
  43. `
  44. }),
  45. license({
  46. banner: `
  47. marked - a markdown parser
  48. Copyright (c) 2011-${new Date().getFullYear()}, Christopher Jeffrey. (MIT Licensed)
  49. https://github.com/markedjs/marked
  50. `
  51. }),
  52. commonjs(),
  53. babel({
  54. presets: [['@babel/preset-env', { loose: true }]]
  55. })
  56. ]
  57. }];