vite-bundle-explorer 0.3.3 → 0.3.4

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.
@@ -146,16 +146,16 @@ function statsPlugin(options) {
146
146
  } catch (e) {}
147
147
  await fs.mkdir(target);
148
148
  if (emitHtml) {
149
- const source = join(fileURLToPath(import.meta.url), "..", "dist-ui");
149
+ const source = join(fileURLToPath(import.meta.url), "..", "..", "dist-ui");
150
150
  const names = await fs.readdir(source);
151
151
  await Promise.all(names.map((name) => {
152
152
  return fs.cp(join(source, name), join(target, name), { recursive: true });
153
153
  }));
154
154
  let html = await fs.readFile(join(target, "index.html"), "utf-8");
155
155
  html = html.replace("%BUNDLE_STATS%", JSON.stringify(stats).replaceAll("'", "\\'"));
156
- fs.writeFile(join(target, "index.html"), html);
156
+ await fs.writeFile(join(target, "index.html"), html);
157
157
  }
158
- if (emitJson) fs.writeFile(join(target, "stats.json"), JSON.stringify(stats, null, 2));
158
+ if (emitJson) await fs.writeFile(join(target, "stats.json"), JSON.stringify(stats, null, 2));
159
159
  console.log(`Bundle stats saved to ${target}`);
160
160
  if (emitHtml) console.log(`Run "npx vite-bundle-explorer ${target}" to view the stats`);
161
161
  if (check) {
package/package.json CHANGED
@@ -1,15 +1,8 @@
1
1
  {
2
2
  "name": "vite-bundle-explorer",
3
3
  "description": "Bundle analyzer and visualizer tool for Vite",
4
- "version": "0.3.3",
4
+ "version": "0.3.4",
5
5
  "type": "module",
6
- "scripts": {
7
- "dev": "vite",
8
- "build": "vue-tsc -b && pnpm build:plugin && vite build",
9
- "build:plugin": "tsdown",
10
- "format": "prettier src plugin bin vite.config.ts --write",
11
- "release": "pnpm build && pnpm changelogen --release --push && pnpm publish"
12
- },
13
6
  "homepage": "https://github.com/Solant/vite-bundle-explorer#readme",
14
7
  "repository": {
15
8
  "type": "git",
@@ -72,5 +65,12 @@
72
65
  "vite": "^7.1.7",
73
66
  "vue": "^3.5.17",
74
67
  "vue-tsc": "^2.2.12"
68
+ },
69
+ "scripts": {
70
+ "dev": "vite",
71
+ "build": "vue-tsc -b && pnpm build:plugin && vite build",
72
+ "build:plugin": "tsdown",
73
+ "format": "prettier src plugin bin vite.config.ts --write",
74
+ "release": "pnpm build && pnpm changelogen --release --push && pnpm publish"
75
75
  }
76
- }
76
+ }