@necrolab/dashboard 0.4.3 → 0.4.31

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/postinstall.js +17 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@necrolab/dashboard",
3
- "version": "0.4.3",
3
+ "version": "0.4.31",
4
4
  "scripts": {
5
5
  "build": "rm -rf dist && vite build && npx workbox-cli generateSW workbox-config.js",
6
6
  "dev": "vite",
package/postinstall.js CHANGED
@@ -1,9 +1,21 @@
1
- const { execSync } = require("node:child_process");
2
1
  const fs = require("node:fs");
2
+ const { execSync } = require("node:child_process");
3
+
3
4
  const path = require("node:path");
4
5
 
5
- const vitePath = path.resolve(path.join(__dirname, "/node_modules/vite/bin/vite.js"));
6
- if (fs.existsSync(vitePath)) execSync(`node "${vitePath}" build`, { cwd: __dirname, stdio: "inherit" });
6
+ console.log(__dirname);
7
+
8
+ var vitePath = path.resolve(path.join(__dirname, "/../../vite/bin/vite.js"));
9
+ console.log(vitePath);
10
+ execSync(`node "${vitePath}" build`, {
11
+ cwd: __dirname,
12
+ stdio: "inherit"
13
+ });
14
+
15
+ var oldPath = path.resolve("./dist/");
16
+ var distPath = path.resolve(path.join(__dirname, "../../../dashboard/dist/"));
17
+ fs.rmSync(distPath, {
18
+ recursive: true
19
+ });
7
20
 
8
- const distPath = path.resolve(path.join(__dirname, "/dist/"));
9
- if (fs.existsSync(distPath)) fs.rmSync(distPath, { recursive: true });
21
+ fs.renameSync(oldPath, distPath);