rollup 0.55.1 → 0.55.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +40 -4
  3. package/bin/rollup +13 -4
  4. package/dist/rollup.browser.js +134 -79
  5. package/dist/rollup.es.js +135 -80
  6. package/dist/rollup.js +136 -81
  7. package/dist/typings/Chunk.d.ts +4 -0
  8. package/dist/typings/Graph.d.ts +1 -2
  9. package/dist/typings/rollup/index.d.ts +1 -0
  10. package/dist/typings/utils/defaults.d.ts +2 -1
  11. package/dist/typings/utils/renderHelpers.d.ts +12 -0
  12. package/dist/typings/watch/index.d.ts +1 -1
  13. package/package.json +10 -5
  14. package/dist/typings/Bundle.d.ts +0 -29
  15. package/dist/typings/ast/Node.d.ts +0 -185
  16. package/dist/typings/ast/nodes/Declaration.d.ts +0 -8
  17. package/dist/typings/ast/nodes/Expression.d.ts +0 -46
  18. package/dist/typings/ast/nodes/Pattern.d.ts +0 -12
  19. package/dist/typings/ast/nodes/Statement.d.ts +0 -10
  20. package/dist/typings/ast/nodes/shared/VirtualObjectExpression.d.ts +0 -7
  21. package/dist/typings/ast/nodes/shared/disallowIllegalReassignment.d.ts +0 -6
  22. package/dist/typings/bin/src/index.d.ts +0 -1
  23. package/dist/typings/bin/src/logging.d.ts +0 -3
  24. package/dist/typings/bin/src/run/alternateScreen.d.ts +0 -8
  25. package/dist/typings/bin/src/run/batchWarnings.d.ts +0 -11
  26. package/dist/typings/bin/src/run/build.d.ts +0 -9
  27. package/dist/typings/bin/src/run/index.d.ts +0 -1
  28. package/dist/typings/bin/src/run/loadConfigFile.d.ts +0 -6
  29. package/dist/typings/bin/src/run/watch.d.ts +0 -8
  30. package/dist/typings/bin/src/sourceMappingUrl.d.ts +0 -2
  31. package/dist/typings/bin/src/utils/sequence.d.ts +0 -4
  32. package/dist/typings/browser/fs.d.ts +0 -5
  33. package/dist/typings/browser/path.d.ts +0 -10
  34. package/dist/typings/src/Bundle.d.ts +0 -29
  35. package/dist/typings/src/ExternalModule.d.ts +0 -23
  36. package/dist/typings/src/Graph.d.ts +0 -60
  37. package/dist/typings/src/Module.d.ts +0 -137
  38. package/dist/typings/src/ast/CallOptions.d.ts +0 -24
  39. package/dist/typings/src/ast/Entity.d.ts +0 -19
  40. package/dist/typings/src/ast/ExecutionPathOptions.d.ts +0 -97
  41. package/dist/typings/src/ast/Node.d.ts +0 -186
  42. package/dist/typings/src/ast/clone.d.ts +0 -1
  43. package/dist/typings/src/ast/comment.d.ts +0 -4
  44. package/dist/typings/src/ast/enhance.d.ts +0 -7
  45. package/dist/typings/src/ast/keys.d.ts +0 -4
  46. package/dist/typings/src/ast/nodes/ArrayExpression.d.ts +0 -9
  47. package/dist/typings/src/ast/nodes/ArrayPattern.d.ts +0 -21
  48. package/dist/typings/src/ast/nodes/ArrowFunctionExpression.d.ts +0 -48
  49. package/dist/typings/src/ast/nodes/AssignmentExpression.d.ts +0 -16
  50. package/dist/typings/src/ast/nodes/AssignmentPattern.d.ts +0 -23
  51. package/dist/typings/src/ast/nodes/AssignmentProperty.d.ts +0 -10
  52. package/dist/typings/src/ast/nodes/AwaitExpression.d.ts +0 -8
  53. package/dist/typings/src/ast/nodes/BinaryExpression.d.ts +0 -38
  54. package/dist/typings/src/ast/nodes/BlockStatement.d.ts +0 -19
  55. package/dist/typings/src/ast/nodes/BreakStatement.d.ts +0 -9
  56. package/dist/typings/src/ast/nodes/CallExpression.d.ts +0 -45
  57. package/dist/typings/src/ast/nodes/CatchClause.d.ts +0 -14
  58. package/dist/typings/src/ast/nodes/ClassBody.d.ts +0 -17
  59. package/dist/typings/src/ast/nodes/ClassDeclaration.d.ts +0 -11
  60. package/dist/typings/src/ast/nodes/ClassExpression.d.ts +0 -10
  61. package/dist/typings/src/ast/nodes/ConditionalExpression.d.ts +0 -50
  62. package/dist/typings/src/ast/nodes/Declaration.d.ts +0 -8
  63. package/dist/typings/src/ast/nodes/DoWhileStatement.d.ts +0 -10
  64. package/dist/typings/src/ast/nodes/EmptyStatement.d.ts +0 -7
  65. package/dist/typings/src/ast/nodes/ExportAllDeclaration.d.ts +0 -11
  66. package/dist/typings/src/ast/nodes/ExportDefaultDeclaration.d.ts +0 -18
  67. package/dist/typings/src/ast/nodes/ExportNamedDeclaration.d.ts +0 -24
  68. package/dist/typings/src/ast/nodes/ExportSpecifier.d.ts +0 -8
  69. package/dist/typings/src/ast/nodes/Expression.d.ts +0 -46
  70. package/dist/typings/src/ast/nodes/ExpressionStatement.d.ts +0 -5
  71. package/dist/typings/src/ast/nodes/ForInStatement.d.ts +0 -17
  72. package/dist/typings/src/ast/nodes/ForOfStatement.d.ts +0 -18
  73. package/dist/typings/src/ast/nodes/ForStatement.d.ts +0 -16
  74. package/dist/typings/src/ast/nodes/FunctionDeclaration.d.ts +0 -9
  75. package/dist/typings/src/ast/nodes/FunctionExpression.d.ts +0 -6
  76. package/dist/typings/src/ast/nodes/Identifier.d.ts +0 -56
  77. package/dist/typings/src/ast/nodes/IfStatement.d.ts +0 -15
  78. package/dist/typings/src/ast/nodes/Import.d.ts +0 -20
  79. package/dist/typings/src/ast/nodes/ImportDeclaration.d.ts +0 -19
  80. package/dist/typings/src/ast/nodes/ImportDefaultSpecifier.d.ts +0 -7
  81. package/dist/typings/src/ast/nodes/ImportNamespaceSpecifier.d.ts +0 -7
  82. package/dist/typings/src/ast/nodes/ImportSpecifier.d.ts +0 -8
  83. package/dist/typings/src/ast/nodes/LabeledStatement.d.ts +0 -10
  84. package/dist/typings/src/ast/nodes/Literal.d.ts +0 -22
  85. package/dist/typings/src/ast/nodes/LogicalExpression.d.ts +0 -47
  86. package/dist/typings/src/ast/nodes/MemberExpression.d.ts +0 -61
  87. package/dist/typings/src/ast/nodes/MethodDefinition.d.ts +0 -20
  88. package/dist/typings/src/ast/nodes/NewExpression.d.ts +0 -17
  89. package/dist/typings/src/ast/nodes/ObjectExpression.d.ts +0 -52
  90. package/dist/typings/src/ast/nodes/ObjectPattern.d.ts +0 -22
  91. package/dist/typings/src/ast/nodes/Pattern.d.ts +0 -12
  92. package/dist/typings/src/ast/nodes/Program.d.ts +0 -7
  93. package/dist/typings/src/ast/nodes/Property.d.ts +0 -57
  94. package/dist/typings/src/ast/nodes/RestElement.d.ts +0 -21
  95. package/dist/typings/src/ast/nodes/ReturnStatement.d.ts +0 -10
  96. package/dist/typings/src/ast/nodes/SequenceExpression.d.ts +0 -12
  97. package/dist/typings/src/ast/nodes/SpreadElement.d.ts +0 -6
  98. package/dist/typings/src/ast/nodes/Statement.d.ts +0 -10
  99. package/dist/typings/src/ast/nodes/SwitchCase.d.ts +0 -9
  100. package/dist/typings/src/ast/nodes/SwitchStatement.d.ts +0 -13
  101. package/dist/typings/src/ast/nodes/TaggedTemplateExpression.d.ts +0 -13
  102. package/dist/typings/src/ast/nodes/TemplateElement.d.ts +0 -12
  103. package/dist/typings/src/ast/nodes/TemplateLiteral.d.ts +0 -10
  104. package/dist/typings/src/ast/nodes/ThisExpression.d.ts +0 -22
  105. package/dist/typings/src/ast/nodes/ThrowStatement.d.ts +0 -9
  106. package/dist/typings/src/ast/nodes/UnaryExpression.d.ts +0 -19
  107. package/dist/typings/src/ast/nodes/UnknownNode.d.ts +0 -5
  108. package/dist/typings/src/ast/nodes/UpdateExpression.d.ts +0 -16
  109. package/dist/typings/src/ast/nodes/VariableDeclaration.d.ts +0 -23
  110. package/dist/typings/src/ast/nodes/VariableDeclarator.d.ts +0 -15
  111. package/dist/typings/src/ast/nodes/WhileStatement.d.ts +0 -10
  112. package/dist/typings/src/ast/nodes/YieldExpression.d.ts +0 -9
  113. package/dist/typings/src/ast/nodes/index.d.ts +0 -69
  114. package/dist/typings/src/ast/nodes/shared/ClassNode.d.ts +0 -27
  115. package/dist/typings/src/ast/nodes/shared/Expression.d.ts +0 -42
  116. package/dist/typings/src/ast/nodes/shared/FunctionNode.d.ts +0 -42
  117. package/dist/typings/src/ast/nodes/shared/Node.d.ts +0 -169
  118. package/dist/typings/src/ast/nodes/shared/Pattern.d.ts +0 -3
  119. package/dist/typings/src/ast/nodes/shared/Statement.d.ts +0 -6
  120. package/dist/typings/src/ast/nodes/shared/VirtualObjectExpression.d.ts +0 -7
  121. package/dist/typings/src/ast/nodes/shared/disallowIllegalReassignment.d.ts +0 -6
  122. package/dist/typings/src/ast/nodes/shared/pureFunctions.d.ts +0 -4
  123. package/dist/typings/src/ast/scopes/BlockScope.d.ts +0 -12
  124. package/dist/typings/src/ast/scopes/CatchScope.d.ts +0 -13
  125. package/dist/typings/src/ast/scopes/FunctionScope.d.ts +0 -27
  126. package/dist/typings/src/ast/scopes/GlobalScope.d.ts +0 -6
  127. package/dist/typings/src/ast/scopes/ModuleScope.d.ts +0 -11
  128. package/dist/typings/src/ast/scopes/ParameterScope.d.ts +0 -16
  129. package/dist/typings/src/ast/scopes/ReturnValueScope.d.ts +0 -24
  130. package/dist/typings/src/ast/scopes/Scope.d.ts +0 -49
  131. package/dist/typings/src/ast/utils/extractNames.d.ts +0 -2
  132. package/dist/typings/src/ast/values.d.ts +0 -5
  133. package/dist/typings/src/ast/variables/ArgumentsVariable.d.ts +0 -30
  134. package/dist/typings/src/ast/variables/ExportDefaultVariable.d.ts +0 -19
  135. package/dist/typings/src/ast/variables/ExternalVariable.d.ts +0 -17
  136. package/dist/typings/src/ast/variables/GlobalVariable.d.ts +0 -12
  137. package/dist/typings/src/ast/variables/LocalVariable.d.ts +0 -51
  138. package/dist/typings/src/ast/variables/NamespaceVariable.d.ts +0 -23
  139. package/dist/typings/src/ast/variables/ParameterVariable.d.ts +0 -6
  140. package/dist/typings/src/ast/variables/ReplaceableInitializationVariable.d.ts +0 -33
  141. package/dist/typings/src/ast/variables/ThisVariable.d.ts +0 -4
  142. package/dist/typings/src/ast/variables/Variable.d.ts +0 -63
  143. package/dist/typings/src/ast/variables/VariableReassignmentTracker.d.ts +0 -25
  144. package/dist/typings/src/banner.d.ts +0 -0
  145. package/dist/typings/src/browser-entry.d.ts +0 -2
  146. package/dist/typings/src/finalisers/amd.d.ts +0 -21
  147. package/dist/typings/src/finalisers/cjs.d.ts +0 -20
  148. package/dist/typings/src/finalisers/es.d.ts +0 -17
  149. package/dist/typings/src/finalisers/iife.d.ts +0 -20
  150. package/dist/typings/src/finalisers/index.d.ts +0 -25
  151. package/dist/typings/src/finalisers/shared/esModuleExport.d.ts +0 -2
  152. package/dist/typings/src/finalisers/shared/getExportBlock.d.ts +0 -6
  153. package/dist/typings/src/finalisers/shared/getGlobalNameMaker.d.ts +0 -9
  154. package/dist/typings/src/finalisers/shared/getInteropBlock.d.ts +0 -6
  155. package/dist/typings/src/finalisers/shared/sanitize.d.ts +0 -2
  156. package/dist/typings/src/finalisers/shared/setupNamespace.d.ts +0 -7
  157. package/dist/typings/src/finalisers/shared/trimEmptyImports.d.ts +0 -5
  158. package/dist/typings/src/finalisers/shared/warnOnBuiltins.d.ts +0 -2
  159. package/dist/typings/src/finalisers/umd.d.ts +0 -21
  160. package/dist/typings/src/node-entry.d.ts +0 -5
  161. package/dist/typings/src/rollup/index.d.ts +0 -172
  162. package/dist/typings/src/utils/array.d.ts +0 -4
  163. package/dist/typings/src/utils/callIfFunction.d.ts +0 -1
  164. package/dist/typings/src/utils/collapseSourcemaps.d.ts +0 -11
  165. package/dist/typings/src/utils/defaults.d.ts +0 -6
  166. package/dist/typings/src/utils/deprecateOptions.d.ts +0 -9
  167. package/dist/typings/src/utils/dynamic-import-plugin.d.ts +0 -8
  168. package/dist/typings/src/utils/ensureArray.d.ts +0 -2
  169. package/dist/typings/src/utils/error.d.ts +0 -18
  170. package/dist/typings/src/utils/first.d.ts +0 -3
  171. package/dist/typings/src/utils/flushTime.d.ts +0 -5
  172. package/dist/typings/src/utils/fs.d.ts +0 -6
  173. package/dist/typings/src/utils/getCodeFrame.d.ts +0 -5
  174. package/dist/typings/src/utils/getExportMode.d.ts +0 -6
  175. package/dist/typings/src/utils/getIndentString.d.ts +0 -7
  176. package/dist/typings/src/utils/identifierHelpers.d.ts +0 -3
  177. package/dist/typings/src/utils/mergeOptions.d.ts +0 -21
  178. package/dist/typings/src/utils/object.d.ts +0 -9
  179. package/dist/typings/src/utils/path.d.ts +0 -6
  180. package/dist/typings/src/utils/promise.d.ts +0 -5
  181. package/dist/typings/src/utils/relativeId.d.ts +0 -1
  182. package/dist/typings/src/utils/sourceMappingURL.d.ts +0 -3
  183. package/dist/typings/src/utils/transform.d.ts +0 -16
  184. package/dist/typings/src/utils/transformBundle.d.ts +0 -8
  185. package/dist/typings/src/watch/chokidar.d.ts +0 -4
  186. package/dist/typings/src/watch/fileWatchers.d.ts +0 -23
  187. package/dist/typings/src/watch/index.d.ts +0 -48
  188. package/dist/typings/utils/array.d.ts +0 -4
  189. package/dist/typings/utils/dynamic-import-plugin.d.ts +0 -13
@@ -1,25 +0,0 @@
1
- import ExecutionPathOptions from "../ExecutionPathOptions";
2
- import { ExpressionEntity } from "../nodes/shared/Expression";
3
- export interface UnknownKey {
4
- type: "UNKNOWN_KEY";
5
- }
6
- export declare type ObjectPathKey = string | UnknownKey;
7
- export declare type ObjectPath = ObjectPathKey[];
8
- export declare function isUnknownKey(key: ObjectPathKey): key is UnknownKey;
9
- export declare const UNKNOWN_KEY: UnknownKey;
10
- export declare type PathCallback = (
11
- path: ObjectPath,
12
- expression: ExpressionEntity
13
- ) => void;
14
- export declare type PathPredicate = (
15
- path: ObjectPath,
16
- expression: ExpressionEntity
17
- ) => boolean;
18
- export default class VariableReassignmentTracker {
19
- private _initialExpression;
20
- private _reassignedPathTracker;
21
- constructor(initialExpression: ExpressionEntity);
22
- reassignPath(path: ObjectPath, options: ExecutionPathOptions): void;
23
- forEachAtPath(path: ObjectPath, callback: PathCallback): void;
24
- someAtPath(path: ObjectPath, predicateFunction: PathPredicate): boolean;
25
- }
File without changes
@@ -1,2 +0,0 @@
1
- export { default as rollup } from "./rollup/index";
2
- export { version as VERSION } from "package.json";
@@ -1,21 +0,0 @@
1
- import Bundle from "../Bundle";
2
- import { Bundle as MagicStringBundle } from "magic-string";
3
- import { OutputOptions } from "../rollup/index";
4
- export default function amd(
5
- bundle: Bundle,
6
- magicString: MagicStringBundle,
7
- {
8
- exportMode,
9
- getPath,
10
- indentString,
11
- intro,
12
- outro
13
- }: {
14
- exportMode: string;
15
- indentString: string;
16
- getPath: (name: string) => string;
17
- intro: string;
18
- outro: string;
19
- },
20
- options: OutputOptions
21
- ): any;
@@ -1,20 +0,0 @@
1
- import { OutputOptions } from "../rollup/index";
2
- import { Bundle as MagicStringBundle } from "magic-string";
3
- import Bundle from "../Bundle";
4
- export default function cjs(
5
- bundle: Bundle,
6
- magicString: MagicStringBundle,
7
- {
8
- exportMode,
9
- getPath,
10
- intro,
11
- outro
12
- }: {
13
- exportMode: string;
14
- indentString: string;
15
- getPath: (name: string) => string;
16
- intro: string;
17
- outro: string;
18
- },
19
- options: OutputOptions
20
- ): MagicStringBundle;
@@ -1,17 +0,0 @@
1
- import { Bundle as MagicStringBundle } from "magic-string";
2
- import Bundle from "../Bundle";
3
- export default function es(
4
- bundle: Bundle,
5
- magicString: MagicStringBundle,
6
- {
7
- getPath,
8
- intro,
9
- outro
10
- }: {
11
- exportMode: string;
12
- indentString: string;
13
- getPath: (name: string) => string;
14
- intro: string;
15
- outro: string;
16
- }
17
- ): any;
@@ -1,20 +0,0 @@
1
- import Bundle from "../Bundle";
2
- import { Bundle as MagicStringBundle } from "magic-string";
3
- import { OutputOptions } from "../rollup/index";
4
- export default function iife(
5
- bundle: Bundle,
6
- magicString: MagicStringBundle,
7
- {
8
- exportMode,
9
- indentString,
10
- intro,
11
- outro
12
- }: {
13
- exportMode: string;
14
- indentString: string;
15
- getPath: (name: string) => string;
16
- intro: string;
17
- outro: string;
18
- },
19
- options: OutputOptions
20
- ): any;
@@ -1,25 +0,0 @@
1
- import Bundle from "../Bundle";
2
- import { Bundle as MagicStringBundle } from "magic-string";
3
- import { OutputOptions } from "../rollup/index";
4
- export declare type Finaliser = (
5
- bundle: Bundle,
6
- magicString: MagicStringBundle,
7
- {
8
- exportMode,
9
- getPath,
10
- indentString,
11
- intro,
12
- outro
13
- }: {
14
- exportMode: string;
15
- indentString: string;
16
- getPath: (name: string) => string;
17
- intro: string;
18
- outro: string;
19
- },
20
- options: OutputOptions
21
- ) => MagicStringBundle;
22
- declare const _default: {
23
- [format: string]: Finaliser;
24
- };
25
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: "Object.defineProperty(exports, '__esModule', { value: true });";
2
- export default _default;
@@ -1,6 +0,0 @@
1
- import Bundle from "../../Bundle";
2
- export default function getExportBlock(
3
- bundle: Bundle,
4
- exportMode: string,
5
- mechanism?: string
6
- ): string;
@@ -1,9 +0,0 @@
1
- import Bundle from "../../Bundle";
2
- import Module from "../../Module";
3
- import { GlobalsOption } from "../../rollup/index";
4
- import ExternalModule from "../../ExternalModule";
5
- export default function getGlobalNameMaker(
6
- globals: GlobalsOption,
7
- bundle: Bundle,
8
- fallback?: string
9
- ): (module: Module | ExternalModule) => string;
@@ -1,6 +0,0 @@
1
- import { OutputOptions } from "../../rollup/index";
2
- import Bundle from "../../Bundle";
3
- export default function getInteropBlock(
4
- bundle: Bundle,
5
- options: OutputOptions
6
- ): string;
@@ -1,2 +0,0 @@
1
- export declare function property(prop: string): string;
2
- export declare function keypath(keypath: string): string;
@@ -1,7 +0,0 @@
1
- import { GlobalsOption } from "../../rollup/index";
2
- export default function setupNamespace(
3
- name: string,
4
- root: string,
5
- forAssignment: boolean,
6
- globals: GlobalsOption
7
- ): string;
@@ -1,5 +0,0 @@
1
- import Module from "../../Module";
2
- import ExternalModule from "../../ExternalModule";
3
- export default function trimEmptyImports(
4
- modules: (Module | ExternalModule)[]
5
- ): (Module | ExternalModule)[];
@@ -1,2 +0,0 @@
1
- import Bundle from "../../Bundle";
2
- export default function warnOnBuiltins(bundle: Bundle): void;
@@ -1,21 +0,0 @@
1
- import Bundle from "../Bundle";
2
- import { Bundle as MagicStringBundle } from "magic-string";
3
- import { OutputOptions } from "../rollup/index";
4
- export default function umd(
5
- bundle: Bundle,
6
- magicString: MagicStringBundle,
7
- {
8
- exportMode,
9
- indentString,
10
- getPath,
11
- intro,
12
- outro
13
- }: {
14
- exportMode: string;
15
- indentString: string;
16
- getPath: (name: string) => string;
17
- intro: string;
18
- outro: string;
19
- },
20
- options: OutputOptions
21
- ): any;
@@ -1,5 +0,0 @@
1
- export * from "./rollup/index";
2
- export * from "./watch/index";
3
- export { default as rollup } from "./rollup/index";
4
- export { default as watch } from "./watch/index";
5
- export { version as VERSION } from "package.json";
@@ -1,172 +0,0 @@
1
- import { GenericConfigObject } from "../utils/mergeOptions";
2
- import { ModuleJSON } from "../Module";
3
- import { RawSourceMap } from "source-map";
4
- import Program from "../ast/nodes/Program";
5
- import { SourceMap } from "magic-string";
6
- import { WatcherOptions } from "../watch/index";
7
- export declare const VERSION = "<@VERSION@>";
8
- export declare type SourceDescription = {
9
- code: string;
10
- map?: RawSourceMap;
11
- ast?: Program;
12
- };
13
- export declare type ResolveIdHook = (
14
- id: string,
15
- parent: string
16
- ) => Promise<string | boolean | void> | string | boolean | void;
17
- export declare type IsExternalHook = (
18
- id: string,
19
- parentId: string,
20
- isResolved: boolean
21
- ) => Promise<boolean | void> | boolean | void;
22
- export declare type LoadHook = (
23
- id: string
24
- ) =>
25
- | Promise<SourceDescription | string | void>
26
- | SourceDescription
27
- | string
28
- | void;
29
- export declare type TransformHook = (
30
- code: string,
31
- id: String
32
- ) => Promise<SourceDescription | string | void>;
33
- export declare type TransformBundleHook = (
34
- code: string,
35
- options: OutputOptions
36
- ) => Promise<SourceDescription | string>;
37
- export declare type ResolveDynamicImportHook = (
38
- specifier: string | Node,
39
- parentId: string
40
- ) => Promise<string | void> | string | void;
41
- export interface Plugin {
42
- name: string;
43
- options?: (options: InputOptions) => void;
44
- load?: LoadHook;
45
- resolveId?: ResolveIdHook;
46
- transform?: TransformHook;
47
- transformBundle?: TransformBundleHook;
48
- ongenerate?: (options: OutputOptions, source: SourceDescription) => void;
49
- onwrite?: (options: OutputOptions, source: SourceDescription) => void;
50
- resolveDynamicImport?: ResolveDynamicImportHook;
51
- banner?: () => string;
52
- footer?: () => string;
53
- intro?: () => string;
54
- outro?: () => string;
55
- }
56
- export interface TreeshakingOptions {
57
- propertyReadSideEffects: boolean;
58
- pureExternalModules: boolean;
59
- }
60
- export declare type ExternalOption = string[] | IsExternalHook;
61
- export declare type GlobalsOption =
62
- | {
63
- [name: string]: string;
64
- }
65
- | ((name: string) => string);
66
- export interface InputOptions {
67
- input: string;
68
- external?: ExternalOption;
69
- plugins?: Plugin[];
70
- onwarn?: WarningHandler;
71
- cache?: {
72
- modules: ModuleJSON[];
73
- };
74
- acorn?: {};
75
- treeshake?: boolean | TreeshakingOptions;
76
- context?: string;
77
- moduleContext?:
78
- | string
79
- | ((id: string) => string)
80
- | {
81
- [id: string]: string;
82
- };
83
- legacy?: boolean;
84
- watch?: WatcherOptions;
85
- experimentalDynamicImport?: boolean;
86
- pureExternalModules?: boolean;
87
- preferConst?: boolean;
88
- entry?: string;
89
- transform?: TransformHook;
90
- load?: LoadHook;
91
- resolveId?: ResolveIdHook;
92
- resolveExternal?: any;
93
- }
94
- export declare type ModuleFormat =
95
- | "amd"
96
- | "cjs"
97
- | "es"
98
- | "es6"
99
- | "iife"
100
- | "umd";
101
- export interface OutputOptions {
102
- file?: string;
103
- format?: ModuleFormat;
104
- name?: string;
105
- globals?: GlobalsOption;
106
- paths?: Record<string, string> | ((id: string) => string);
107
- banner?: string;
108
- footer?: string;
109
- intro?: string;
110
- outro?: string;
111
- sourcemap?: boolean | "inline";
112
- sourcemapFile?: string;
113
- interop?: boolean;
114
- extend?: boolean;
115
- exports?: "default" | "named" | "none" | "auto";
116
- amd?: {
117
- id?: string;
118
- define?: string;
119
- };
120
- indent?: boolean;
121
- strict?: boolean;
122
- freeze?: boolean;
123
- legacy?: boolean;
124
- noConflict?: boolean;
125
- dest?: string;
126
- moduleId?: string;
127
- }
128
- export interface RollupWarning {
129
- message?: string;
130
- code?: string;
131
- loc?: {
132
- file: string;
133
- line: number;
134
- column: number;
135
- };
136
- deprecations?: {
137
- old: string;
138
- new: string;
139
- }[];
140
- modules?: string[];
141
- names?: string[];
142
- source?: string;
143
- importer?: string;
144
- frame?: any;
145
- missing?: string;
146
- exporter?: string;
147
- name?: string;
148
- sources?: string[];
149
- reexporter?: string;
150
- guess?: string;
151
- url?: string;
152
- id?: string;
153
- plugin?: string;
154
- pos?: number;
155
- pluginCode?: string;
156
- }
157
- export declare type WarningHandler = (warning: RollupWarning) => void;
158
- export interface OutputBundle {
159
- imports: string[];
160
- exports: string[];
161
- modules: ModuleJSON[];
162
- generate: (
163
- outputOptions: OutputOptions
164
- ) => Promise<{
165
- code: string;
166
- map: SourceMap;
167
- }>;
168
- write: (options: OutputOptions) => Promise<void>;
169
- }
170
- export default function rollup(
171
- rawInputOptions: GenericConfigObject
172
- ): Promise<OutputBundle>;
@@ -1,4 +0,0 @@
1
- export declare function find<T>(
2
- array: T[],
3
- fn: (item: T, index: number) => boolean
4
- ): T;
@@ -1 +0,0 @@
1
- export default function callIfFunction<T>(thing: T | (() => T)): T;
@@ -1,11 +0,0 @@
1
- /// <reference path="../../../../src/utils/collapseSourcemaps.d.ts" />
2
- import Module from "../Module";
3
- import { RawSourceMap } from "source-map";
4
- import Bundle from "../Bundle";
5
- export default function collapseSourcemaps(
6
- bundle: Bundle,
7
- file: string,
8
- map: RawSourceMap,
9
- modules: Module[],
10
- bundleSourcemapChain: RawSourceMap[]
11
- ): RawSourceMap;
@@ -1,6 +0,0 @@
1
- export declare function load(id: string): string;
2
- export declare function resolveId(
3
- importee: string,
4
- importer: string
5
- ): string | void;
6
- export declare function makeOnwarn(): (warning: any) => void;
@@ -1,9 +0,0 @@
1
- import { GenericConfigObject } from "./mergeOptions";
2
- export declare type Deprecation = {
3
- old: string;
4
- new: string;
5
- };
6
- export default function deprecateOptions(
7
- options: GenericConfigObject,
8
- deprecateConfig: GenericConfigObject
9
- ): Deprecation[];
@@ -1,8 +0,0 @@
1
- /// <reference types="acorn" />
2
- import { PluginsObject, TokenType } from "acorn";
3
- export default function wrapDynamicImportPlugin(acorn: {
4
- tokTypes: {
5
- [type: string]: TokenType;
6
- };
7
- plugins: PluginsObject;
8
- }): (_moduleDynamicImportsReturnBinding: any[]) => void;
@@ -1,2 +0,0 @@
1
- export default function ensureArray<T>(thing: T[]): T[];
2
- export default function ensureArray(thing: any): any[];
@@ -1,18 +0,0 @@
1
- export interface RollupError {
2
- message: string;
3
- code?: string;
4
- name?: string;
5
- url?: string;
6
- id?: string;
7
- loc?: {
8
- file?: string;
9
- line: number;
10
- column: number;
11
- };
12
- stack?: string;
13
- frame?: string;
14
- pos?: number;
15
- plugin?: string;
16
- pluginCode?: string;
17
- }
18
- export default function error(props: Error | RollupError): void;
@@ -1,3 +0,0 @@
1
- export default function first<T>(
2
- candidates: ((...args: any[]) => Promise<T | void> | T | void)[]
3
- ): (...args: any[]) => Promise<T | void>;
@@ -1,5 +0,0 @@
1
- export declare function timeStart(label: string): void;
2
- export declare function timeEnd(label: string): void;
3
- export declare function flushTime(log?: typeof defaultLog): void;
4
- /** @interal */
5
- export declare function defaultLog(label: string, time: number): void;
@@ -1,6 +0,0 @@
1
- /// <reference types="node" />
2
- export * from "fs";
3
- export declare function writeFile(
4
- dest: string,
5
- data: string | Buffer
6
- ): Promise<{}>;
@@ -1,5 +0,0 @@
1
- export default function getCodeFrame(
2
- source: string,
3
- line: number,
4
- column: number
5
- ): string;
@@ -1,6 +0,0 @@
1
- import Bundle from "../Bundle";
2
- import { OutputOptions } from "../rollup/index";
3
- export default function getExportMode(
4
- bundle: Bundle,
5
- { exports: exportMode, name, format }: OutputOptions
6
- ): "default" | "named" | "none";
@@ -1,7 +0,0 @@
1
- import { Bundle as MagicStringBundle } from "magic-string";
2
- export default function getIndentString(
3
- magicString: MagicStringBundle,
4
- options: {
5
- indent?: boolean;
6
- }
7
- ): string;
@@ -1,3 +0,0 @@
1
- export declare const reservedWords: string[];
2
- export declare function isLegal(str: string): boolean;
3
- export declare function makeLegal(str: string): string;
@@ -1,21 +0,0 @@
1
- import { WarningHandler } from "../../src/rollup/index";
2
- import { Deprecation } from "./deprecateOptions";
3
- export declare type GenericConfigObject = {
4
- [key: string]: any;
5
- };
6
- export default function mergeOptions({
7
- config,
8
- command,
9
- deprecateConfig,
10
- defaultOnWarnHandler
11
- }: {
12
- config: GenericConfigObject;
13
- command?: GenericConfigObject;
14
- deprecateConfig?: GenericConfigObject;
15
- defaultOnWarnHandler?: WarningHandler;
16
- }): {
17
- inputOptions: any;
18
- outputOptions: any;
19
- deprecations: Deprecation[];
20
- optionError: string | null;
21
- };
@@ -1,9 +0,0 @@
1
- export declare const keys: (o: {}) => string[];
2
- export declare function blank(): any;
3
- export declare function forOwn<T>(
4
- object: {
5
- [key: string]: T;
6
- },
7
- func: (value: T, key: string) => void
8
- ): void;
9
- export declare function assign<T, U>(target: T, source: U): T & U;
@@ -1,6 +0,0 @@
1
- export declare const absolutePath: RegExp;
2
- export declare const relativePath: RegExp;
3
- export declare function isAbsolute(path: string): boolean;
4
- export declare function isRelative(path: string): boolean;
5
- export declare function normalize(path: string): string;
6
- export { basename, dirname, extname, relative, resolve } from "path";
@@ -1,5 +0,0 @@
1
- export declare function mapSequence<T, U>(
2
- array: T[],
3
- fn: (member: T) => Promise<U> | U
4
- ): Promise<U[]>;
5
- export declare function runSequence<T>(array: T[]): Promise<T[]>;
@@ -1 +0,0 @@
1
- export default function relativeId(id: string): any;
@@ -1,3 +0,0 @@
1
- declare let SOURCEMAPPING_URL: string;
2
- declare const SOURCEMAPPING_URL_RE: RegExp;
3
- export { SOURCEMAPPING_URL, SOURCEMAPPING_URL_RE };
@@ -1,16 +0,0 @@
1
- import Graph from "../Graph";
2
- import { RawSourceMap } from "source-map";
3
- import { Plugin, SourceDescription } from "../rollup/index";
4
- import Program from "../ast/nodes/Program";
5
- export default function transform(
6
- graph: Graph,
7
- source: SourceDescription,
8
- id: string,
9
- plugins: Plugin[]
10
- ): Promise<{
11
- code: string;
12
- originalCode: string;
13
- originalSourcemap: any;
14
- ast: Program;
15
- sourcemapChain: RawSourceMap[];
16
- }>;
@@ -1,8 +0,0 @@
1
- import { RawSourceMap } from "source-map";
2
- import { OutputOptions, Plugin } from "../rollup/index";
3
- export default function transformBundle(
4
- code: string,
5
- plugins: Plugin[],
6
- sourcemapChain: RawSourceMap[],
7
- options: OutputOptions
8
- ): Promise<string | void>;
@@ -1,4 +0,0 @@
1
- /// <reference path="../../../../src/watch/chokidar.d.ts" />
2
- import * as chokidarType from "chokidar";
3
- declare let chokidar: typeof chokidarType;
4
- export default chokidar;
@@ -1,23 +0,0 @@
1
- /// <reference types="node" />
2
- import * as fs from "fs";
3
- import { WatchOptions, FSWatcher } from "chokidar";
4
- import { Task } from "./index";
5
- export declare function addTask(
6
- id: string,
7
- task: Task,
8
- chokidarOptions: WatchOptions,
9
- chokidarOptionsHash: string
10
- ): void;
11
- export declare function deleteTask(
12
- id: string,
13
- target: Task,
14
- chokidarOptionsHash: string
15
- ): void;
16
- export default class FileWatcher {
17
- fileExists: boolean;
18
- fsWatcher: FSWatcher | fs.FSWatcher;
19
- tasks: Set<Task>;
20
- constructor(id: string, chokidarOptions: WatchOptions, dispose: () => void);
21
- close(): void;
22
- trigger(): void;
23
- }