vite-plugin-rebundle 1.22.0 → 1.23.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.
package/dist/rebundle.js CHANGED
@@ -50,6 +50,7 @@ var RebundleVite = class {
50
50
  const info = this.config.logger.info;
51
51
  this.config.logger.info = (message, options) => {
52
52
  const path = message.split(/\s+/)[0];
53
+ if (is.absent(path)) return;
53
54
  if (extname(path) === ".js") return;
54
55
  info(message, options);
55
56
  };
@@ -69,7 +70,11 @@ var RebundleVite = class {
69
70
  onWriteBundle = async (_output, bundle) => {
70
71
  const modifiedEntryChunks = this.getEntryChunks(bundle).filter((chunk) => {
71
72
  const usedPaths = [chunk.fileName, ...chunk.imports];
72
- return usedPaths.some((path) => "code" in bundle[path] && bundle[path].code !== this.originals[path]);
73
+ return usedPaths.some((path) => {
74
+ if (!bundle[path]) return false;
75
+ if (!("code" in bundle[path])) return false;
76
+ return bundle[path].code !== this.originals[path];
77
+ });
73
78
  });
74
79
  await Promise.all(
75
80
  modifiedEntryChunks.map(async (chunk) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-rebundle",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "imkost",
@@ -16,18 +16,12 @@
16
16
  "release": "sh -c 'npm version ${1:-minor} && npm run build && npm publish' --"
17
17
  },
18
18
  "exports": {
19
- ".": {
20
- "source": "./src/rebundle.ts",
21
- "import": "./dist/rebundle.js",
22
- "types": "./dist/rebundle.d.ts"
23
- },
24
- "./ts": {
25
- "import": "./src/rebundle.ts"
26
- }
19
+ ".": "./dist/rebundle.js",
20
+ "./ts": "./src/rebundle.ts"
27
21
  },
28
22
  "files": [
29
- "src",
30
- "dist"
23
+ "dist",
24
+ "src"
31
25
  ],
32
26
  "dependencies": {
33
27
  "@types/ws": "^8.18.1",
@@ -35,8 +29,8 @@
35
29
  "dropcap": "^1.0.0",
36
30
  "filesize": "^11.0.13",
37
31
  "portfinder": "^1.0.38",
38
- "rolldown": "^1.0.0-beta.55",
39
- "rollup": "^4.53.5",
32
+ "rolldown": "^1.0.0-beta.57",
33
+ "rollup": "^4.54.0",
40
34
  "vite": "^7.3.0",
41
35
  "ws": "^8.18.3"
42
36
  }
package/src/rebundle.ts CHANGED
@@ -71,6 +71,7 @@ export class RebundleVite {
71
71
  const info = this.config.logger.info
72
72
  this.config.logger.info = (message, options) => {
73
73
  const path = message.split(/\s+/)[0]
74
+ if (is.absent(path)) return
74
75
  if (extname(path) === '.js') return
75
76
  info(message, options)
76
77
  }
@@ -97,7 +98,11 @@ export class RebundleVite {
97
98
  // Get modified entry chunks
98
99
  const modifiedEntryChunks = this.getEntryChunks(bundle).filter(chunk => {
99
100
  const usedPaths = [chunk.fileName, ...chunk.imports]
100
- return usedPaths.some(path => 'code' in bundle[path] && bundle[path].code !== this.originals[path])
101
+ return usedPaths.some(path => {
102
+ if (!bundle[path]) return false
103
+ if (!('code' in bundle[path])) return false
104
+ return bundle[path].code !== this.originals[path]
105
+ })
101
106
  })
102
107
 
103
108
  // Rebundle modified entry chunks