vite-plugin-rebundle 1.2.1 → 1.2.2
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/rebundle.d.ts +2 -0
- package/dist/rebundle.js +7 -0
- package/package.json +1 -1
- package/readme.md +1 -1
package/dist/rebundle.d.ts
CHANGED
|
@@ -10,12 +10,14 @@ export declare class Rebundle extends $utils.Unit {
|
|
|
10
10
|
private config;
|
|
11
11
|
private chunkFiles;
|
|
12
12
|
private rebundledContent;
|
|
13
|
+
private hasError;
|
|
13
14
|
private port;
|
|
14
15
|
private ws;
|
|
15
16
|
constructor(options: OptionsInput);
|
|
16
17
|
get vite(): Plugin;
|
|
17
18
|
private onConfig;
|
|
18
19
|
private onConfigResolved;
|
|
20
|
+
private onBuildEnd;
|
|
19
21
|
private onWriteBundle;
|
|
20
22
|
private get outDir();
|
|
21
23
|
private outPath;
|
package/dist/rebundle.js
CHANGED
|
@@ -10,6 +10,7 @@ export class Rebundle extends $utils.Unit {
|
|
|
10
10
|
config = null;
|
|
11
11
|
chunkFiles = {};
|
|
12
12
|
rebundledContent = {};
|
|
13
|
+
hasError = false;
|
|
13
14
|
port = null;
|
|
14
15
|
ws = null;
|
|
15
16
|
constructor(options) {
|
|
@@ -23,6 +24,7 @@ export class Rebundle extends $utils.Unit {
|
|
|
23
24
|
enforce: 'post',
|
|
24
25
|
config: this.onConfig,
|
|
25
26
|
configResolved: this.onConfigResolved,
|
|
27
|
+
buildEnd: this.onBuildEnd,
|
|
26
28
|
writeBundle: this.onWriteBundle,
|
|
27
29
|
};
|
|
28
30
|
}
|
|
@@ -49,7 +51,12 @@ export class Rebundle extends $utils.Unit {
|
|
|
49
51
|
info(message, options);
|
|
50
52
|
};
|
|
51
53
|
};
|
|
54
|
+
onBuildEnd = (error) => {
|
|
55
|
+
this.hasError = !!error;
|
|
56
|
+
};
|
|
52
57
|
onWriteBundle = async (_output, bundle) => {
|
|
58
|
+
if (this.hasError)
|
|
59
|
+
return;
|
|
53
60
|
const ws = await this.ensureWs();
|
|
54
61
|
const options = await this.getOptions();
|
|
55
62
|
const changedChunkNames = [];
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A Vite plugin that guarantees **one standalone file per entry point**. Each entry is bundled into a single file with no code-splitting or dynamic imports.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Why?
|
|
6
6
|
|
|
7
7
|
Sometimes you need bundles without dynamic imports. Vite/Rollup don’t provide this option when building with multiple entries. This plugin solves it by rebundling Vite’s output with esbuild to enforce single-file output.
|
|
8
8
|
|