rollup.config.dev.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. import resolve from "@rollup/plugin-node-resolve";
  2. import { terser } from "rollup-plugin-terser";
  3. const PLUGINS = [resolve({ moduleDirectories: [".."] })];
  4. const EXTERNAL = ["single-file-core"];
  5. export default [{
  6. input: ["single-file-core/index.js"],
  7. output: [{
  8. file: "lib/single-file.js",
  9. format: "umd",
  10. name: "singlefile",
  11. plugins: []
  12. }],
  13. plugins: PLUGINS,
  14. external: EXTERNAL
  15. }, {
  16. input: ["single-file-core/processors/frame-tree/content/content-frame-tree.js"],
  17. output: [{
  18. file: "lib/single-file-frames.js",
  19. format: "umd",
  20. name: "singlefile",
  21. plugins: []
  22. }],
  23. plugins: PLUGINS,
  24. external: EXTERNAL
  25. }, {
  26. input: ["single-file-core/single-file-bootstrap.js"],
  27. output: [{
  28. file: "lib/single-file-bootstrap.js",
  29. format: "umd",
  30. name: "singlefileBootstrap",
  31. plugins: []
  32. }],
  33. plugins: PLUGINS,
  34. external: EXTERNAL
  35. }, {
  36. input: ["single-file-core/processors/hooks/content/content-hooks-web.js"],
  37. output: [{
  38. file: "lib/single-file-hooks.js",
  39. format: "iife",
  40. plugins: []
  41. }],
  42. plugins: PLUGINS,
  43. external: EXTERNAL
  44. }, {
  45. input: ["single-file-core/processors/hooks/content/content-hooks-frames-web.js"],
  46. output: [{
  47. file: "lib/single-file-hooks-frames.js",
  48. format: "iife",
  49. plugins: []
  50. }],
  51. plugins: PLUGINS,
  52. external: EXTERNAL
  53. }, {
  54. input: ["single-file-core/common/content-infobar-web.js"],
  55. output: [{
  56. file: "lib/single-file-infobar.js",
  57. format: "iife",
  58. plugins: [terser()]
  59. }],
  60. plugins: PLUGINS,
  61. external: EXTERNAL
  62. }, {
  63. input: ["src/core/content/content-infobar.js"],
  64. output: [{
  65. file: "lib/single-file-extension-infobar.js",
  66. format: "umd",
  67. name: "infobar",
  68. plugins: []
  69. }]
  70. }, {
  71. input: ["src/core/content/content-bootstrap.js"],
  72. output: [{
  73. file: "lib/single-file-extension-bootstrap.js",
  74. format: "iife",
  75. plugins: []
  76. }]
  77. }, {
  78. input: ["src/core/content/content-frames.js"],
  79. output: [{
  80. file: "lib/single-file-extension-frames.js",
  81. format: "iife",
  82. plugins: []
  83. }]
  84. }, {
  85. input: ["src/index.js"],
  86. output: [{
  87. file: "lib/single-file-extension-core.js",
  88. format: "umd",
  89. name: "extension",
  90. plugins: []
  91. }]
  92. }, {
  93. input: ["src/core/content/content.js"],
  94. output: [{
  95. file: "lib/single-file-extension.js",
  96. format: "iife",
  97. plugins: []
  98. }]
  99. }, {
  100. input: ["src/ui/content/content-ui-editor-init-web.js"],
  101. output: [{
  102. file: "lib/single-file-extension-editor-init.js",
  103. format: "iife",
  104. plugins: []
  105. }]
  106. }, {
  107. input: ["src/ui/content/content-ui-editor-web.js"],
  108. output: [{
  109. file: "lib/single-file-extension-editor.js",
  110. format: "iife",
  111. plugins: []
  112. }]
  113. }, {
  114. input: ["src/ui/content/content-ui-editor-helper-web"],
  115. output: [{
  116. file: "lib/single-file-extension-editor-helper.js",
  117. format: "umd",
  118. name: "singlefile",
  119. plugins: []
  120. }],
  121. plugins: PLUGINS,
  122. external: EXTERNAL
  123. }, {
  124. input: ["src/lib/single-file/browser-polyfill/chrome-browser-polyfill.js"],
  125. output: [{
  126. file: "lib/chrome-browser-polyfill.js",
  127. format: "iife",
  128. plugins: []
  129. }]
  130. }, {
  131. input: ["src/core/bg/index.js"],
  132. output: [{
  133. file: "lib/single-file-extension-background.js",
  134. format: "iife",
  135. plugins: []
  136. }]
  137. }, {
  138. input: ["src/lib/single-file/background.js"],
  139. output: [{
  140. file: "lib/single-file-background.js",
  141. format: "iife",
  142. plugins: []
  143. }]
  144. }];