vite-plugin-rebundle 1.2.10 → 1.2.12
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 +3 -0
- package/dist/index.js +1 -0
- package/dist/rebundle.js +20 -13
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/rebundle.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as $utils from '@eposlabs/utils';
|
|
2
|
+
import $chalk from 'chalk';
|
|
2
3
|
import * as $esbuild from 'esbuild';
|
|
4
|
+
import { filesize } from 'filesize';
|
|
3
5
|
import * as $fs from 'node:fs/promises';
|
|
4
6
|
import * as $path from 'node:path';
|
|
5
|
-
import * as $utils from '@eposlabs/utils';
|
|
6
|
-
import * as $ws from 'ws';
|
|
7
|
-
import $chalk from 'chalk';
|
|
8
7
|
import $portfinder from 'portfinder';
|
|
8
|
+
import * as $ws from 'ws';
|
|
9
9
|
export const _code_ = Symbol('rebundle:code');
|
|
10
10
|
export const _sourcemap_ = Symbol('rebundle:sourcemap');
|
|
11
11
|
export class Rebundle extends $utils.Unit {
|
|
@@ -112,14 +112,21 @@ export class Rebundle extends $utils.Unit {
|
|
|
112
112
|
return false;
|
|
113
113
|
}
|
|
114
114
|
// Build with esbuild
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
let result;
|
|
116
|
+
try {
|
|
117
|
+
result = await $esbuild.build({
|
|
118
|
+
sourcemap: Boolean(this.config.build.sourcemap),
|
|
119
|
+
...chunkBuildOptions,
|
|
120
|
+
format: 'esm',
|
|
121
|
+
outfile: chunkPath,
|
|
122
|
+
entryPoints: [chunkPath],
|
|
123
|
+
bundle: true,
|
|
124
|
+
allowOverwrite: true,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
123
130
|
// Errors? -> Ignore, esbuild will show errors in console
|
|
124
131
|
if (result.errors.length > 0)
|
|
125
132
|
return;
|
|
@@ -160,7 +167,7 @@ export class Rebundle extends $utils.Unit {
|
|
|
160
167
|
await Promise.all(usedPaths.map(async (path) => {
|
|
161
168
|
const content = await this.read(path);
|
|
162
169
|
if (!content)
|
|
163
|
-
|
|
170
|
+
return;
|
|
164
171
|
files[path] = content;
|
|
165
172
|
}));
|
|
166
173
|
return files;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-rebundle",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "imkost",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@eposlabs/utils": "^1.0.
|
|
25
|
+
"@eposlabs/utils": "^1.0.13",
|
|
26
26
|
"@types/ws": "^8.18.1",
|
|
27
|
-
"chalk": "^5.6.
|
|
27
|
+
"chalk": "^5.6.2",
|
|
28
28
|
"esbuild": "^0.25.9",
|
|
29
29
|
"filesize": "^11.0.2",
|
|
30
|
-
"portfinder": "^1.0.
|
|
31
|
-
"rollup": "^4.50.
|
|
32
|
-
"vite": "^7.1.
|
|
30
|
+
"portfinder": "^1.0.38",
|
|
31
|
+
"rollup": "^4.50.1",
|
|
32
|
+
"vite": "^7.1.5",
|
|
33
33
|
"ws": "^8.18.3"
|
|
34
34
|
}
|
|
35
35
|
}
|