@rollup/browser 4.42.0 → 4.43.0

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.
@@ -244,6 +244,7 @@ export interface PluginContext extends MinimalPluginContext {
244
244
  debug: LoggingFunction;
245
245
  emitFile: EmitFile;
246
246
  error: (error: RollupError | string) => never;
247
+ fs: RollupFsModule;
247
248
  getFileName: (fileReferenceId: string) => string;
248
249
  getModuleIds: () => IterableIterator<string>;
249
250
  getModuleInfo: GetModuleInfo;
@@ -671,6 +672,7 @@ export interface InputOptions {
671
672
  experimentalCacheExpiry?: number;
672
673
  experimentalLogSideEffects?: boolean;
673
674
  external?: ExternalOption;
675
+ fs?: RollupFsModule;
674
676
  input?: InputOption;
675
677
  jsx?: false | JsxPreset | JsxOptions;
676
678
  logLevel?: LogLevelOption;
@@ -699,6 +701,7 @@ export interface NormalizedInputOptions {
699
701
  experimentalCacheExpiry: number;
700
702
  experimentalLogSideEffects: boolean;
701
703
  external: IsExternal;
704
+ fs: RollupFsModule;
702
705
  input: string[] | Record<string, string>;
703
706
  jsx: false | NormalizedJsxOptions;
704
707
  logLevel: LogLevelOption;
@@ -1103,3 +1106,76 @@ export function defineConfig(optionsFunction: RollupOptionsFunction): RollupOpti
1103
1106
  export type RollupOptionsFunction = (
1104
1107
  commandLineArguments: Record<string, any>
1105
1108
  ) => MaybePromise<RollupOptions | RollupOptions[]>;
1109
+
1110
+ export interface RollupFsModule {
1111
+ appendFile(
1112
+ path: string,
1113
+ data: string | Uint8Array,
1114
+ options?: { encoding?: BufferEncoding | null; mode?: string | number; flag?: string | number }
1115
+ ): Promise<void>;
1116
+
1117
+ copyFile(source: string, destination: string, mode?: string | number): Promise<void>;
1118
+
1119
+ mkdir(path: string, options?: { recursive?: boolean; mode?: string | number }): Promise<void>;
1120
+
1121
+ mkdtemp(prefix: string): Promise<string>;
1122
+
1123
+ readdir(path: string, options?: { withFileTypes?: false }): Promise<string[]>;
1124
+ readdir(path: string, options?: { withFileTypes: true }): Promise<RollupDirectoryEntry[]>;
1125
+
1126
+ readFile(
1127
+ path: string,
1128
+ options?: { encoding?: null; flag?: string | number; signal?: AbortSignal }
1129
+ ): Promise<Uint8Array>;
1130
+ readFile(
1131
+ path: string,
1132
+ options?: { encoding: BufferEncoding; flag?: string | number; signal?: AbortSignal }
1133
+ ): Promise<string>;
1134
+
1135
+ realpath(path: string): Promise<string>;
1136
+
1137
+ rename(oldPath: string, newPath: string): Promise<void>;
1138
+
1139
+ rmdir(path: string, options?: { recursive?: boolean }): Promise<void>;
1140
+
1141
+ stat(path: string): Promise<RollupFileStats>;
1142
+
1143
+ lstat(path: string): Promise<RollupFileStats>;
1144
+
1145
+ unlink(path: string): Promise<void>;
1146
+
1147
+ writeFile(
1148
+ path: string,
1149
+ data: string | Uint8Array,
1150
+ options?: { encoding?: BufferEncoding | null; mode?: string | number; flag?: string | number }
1151
+ ): Promise<void>;
1152
+ }
1153
+
1154
+ export type BufferEncoding =
1155
+ | 'ascii'
1156
+ | 'utf8'
1157
+ | 'utf16le'
1158
+ | 'ucs2'
1159
+ | 'base64'
1160
+ | 'base64url'
1161
+ | 'latin1'
1162
+ | 'binary'
1163
+ | 'hex';
1164
+
1165
+ export interface RollupDirectoryEntry {
1166
+ isFile(): boolean;
1167
+ isDirectory(): boolean;
1168
+ isSymbolicLink(): boolean;
1169
+ name: string;
1170
+ }
1171
+
1172
+ export interface RollupFileStats {
1173
+ isFile(): boolean;
1174
+ isDirectory(): boolean;
1175
+ isSymbolicLink(): boolean;
1176
+ size: number;
1177
+ mtime: Date;
1178
+ ctime: Date;
1179
+ atime: Date;
1180
+ birthtime: Date;
1181
+ }