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.

52 lines
1.4 KiB

8 months ago
  1. import buble from '@rollup/plugin-buble';
  2. import copy from 'rollup-plugin-copy'
  3. let copyVim = copy({
  4. targets: [
  5. {
  6. src: require.resolve("cm5-vim/vim.js").replace(/\\/g, "/"),
  7. dest: "./keymap"
  8. }
  9. ]
  10. });
  11. export default [
  12. {
  13. input: "src/codemirror.js",
  14. output: {
  15. banner: `// CodeMirror, copyright (c) by Marijn Haverbeke and others
  16. // Distributed under an MIT license: https://codemirror.net/5/LICENSE
  17. // This is CodeMirror (https://codemirror.net/5), a code editor
  18. // implemented in JavaScript on top of the browser's DOM.
  19. //
  20. // You can find some technical background for some of the code below
  21. // at http://marijnhaverbeke.nl/blog/#cm-internals .
  22. `,
  23. format: "umd",
  24. file: "lib/codemirror.js",
  25. name: "CodeMirror"
  26. },
  27. plugins: [ buble({namedFunctionExpressions: false}), copyVim ]
  28. },
  29. {
  30. input: ["src/addon/runmode/runmode-standalone.js"],
  31. output: {
  32. format: "iife",
  33. file: "addon/runmode/runmode-standalone.js",
  34. name: "CodeMirror",
  35. freeze: false, // IE8 doesn't support Object.freeze.
  36. },
  37. plugins: [ buble({namedFunctionExpressions: false}) ]
  38. },
  39. {
  40. input: ["src/addon/runmode/runmode.node.js"],
  41. output: {
  42. format: "cjs",
  43. file: "addon/runmode/runmode.node.js",
  44. name: "CodeMirror",
  45. freeze: false, // IE8 doesn't support Object.freeze.
  46. },
  47. plugins: [ buble({namedFunctionExpressions: false}) ]
  48. },
  49. ];