vite-plugin-rebundle 1.2.8 → 1.2.10
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.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -1
- package/dist/rebundle.d.ts +1 -3
- package/dist/rebundle.js +1 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export default function rebundle(options?:
|
|
1
|
+
import { type Options } from './rebundle.js';
|
|
2
|
+
export default function rebundle(options?: Options): import("vite").Plugin<any>;
|
package/dist/index.js
CHANGED
package/dist/rebundle.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export declare const _sourcemap_: unique symbol;
|
|
|
7
7
|
export type Options = {
|
|
8
8
|
[chunkName: string]: BuildOptions;
|
|
9
9
|
};
|
|
10
|
-
export type OptionsInput = Options | (() => Options | Promise<Options>);
|
|
11
10
|
export declare class Rebundle extends $utils.Unit {
|
|
12
11
|
private options;
|
|
13
12
|
private config;
|
|
@@ -16,7 +15,7 @@ export declare class Rebundle extends $utils.Unit {
|
|
|
16
15
|
private hasError;
|
|
17
16
|
private port;
|
|
18
17
|
private ws;
|
|
19
|
-
constructor(options:
|
|
18
|
+
constructor(options: Options);
|
|
20
19
|
get vite(): Plugin;
|
|
21
20
|
private onConfig;
|
|
22
21
|
private onConfigResolved;
|
|
@@ -31,6 +30,5 @@ export declare class Rebundle extends $utils.Unit {
|
|
|
31
30
|
private write;
|
|
32
31
|
private remove;
|
|
33
32
|
private ensureWs;
|
|
34
|
-
private getOptions;
|
|
35
33
|
private removeDirectoryIfEmpty;
|
|
36
34
|
}
|
package/dist/rebundle.js
CHANGED
|
@@ -91,9 +91,8 @@ export class Rebundle extends $utils.Unit {
|
|
|
91
91
|
// Delete chunk from bundle to hide log for vite-rolldown.
|
|
92
92
|
// Call for rollup as well for consistency.
|
|
93
93
|
delete bundle[chunk.fileName];
|
|
94
|
-
const options = await this.getOptions();
|
|
95
94
|
const chunkPath = this.resolve(chunk.fileName);
|
|
96
|
-
const chunkBuildOptions = options[chunk.name] ?? {};
|
|
95
|
+
const chunkBuildOptions = this.options[chunk.name] ?? {};
|
|
97
96
|
const chunkFiles = await this.readChunkFiles(chunk);
|
|
98
97
|
const chunkFilePaths = Object.keys(chunkFiles);
|
|
99
98
|
const chunkChanged = chunkFilePaths.some(path => chunkFiles[path] !== this.chunkFiles[path]);
|
|
@@ -195,11 +194,6 @@ export class Rebundle extends $utils.Unit {
|
|
|
195
194
|
this.ws = new $ws.WebSocketServer({ port: this.port });
|
|
196
195
|
return this.ws;
|
|
197
196
|
}
|
|
198
|
-
async getOptions() {
|
|
199
|
-
if (typeof this.options !== 'function')
|
|
200
|
-
return this.options;
|
|
201
|
-
return await this.options();
|
|
202
|
-
}
|
|
203
197
|
async removeDirectoryIfEmpty(dir) {
|
|
204
198
|
const files = await $fs.readdir(dir);
|
|
205
199
|
if (files.length > 0)
|