pankosmia-rcl 0.1.14 → 0.1.15

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/build.js +36 -0
  2. package/package.json +5 -5
package/build.js ADDED
@@ -0,0 +1,36 @@
1
+ // build.js
2
+ import path from "path";
3
+ import { fileURLToPath } from "url";
4
+ import { build as viteBuild } from "vite";
5
+
6
+ // Get __dirname equivalent in ES modules
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+
10
+ // 1️⃣ Build the app (HTML + assets)
11
+ await viteBuild({
12
+ configFile: path.resolve(__dirname, "vite.config.js"),
13
+ build: {
14
+ outDir: "build",
15
+ emptyOutDir: true
16
+ }
17
+ });
18
+
19
+ // 2️⃣ Build the library
20
+ await viteBuild({
21
+ configFile: path.resolve(__dirname, "vite.config.js"),
22
+ build: {
23
+ lib: {
24
+ entry: path.resolve(__dirname, "./src/rcl/index.js"),
25
+ name: "pankosmia-rcl",
26
+ fileName: (format) => `pankosmia-rcl.${format}.js`, // Fixed template literal
27
+ },
28
+ outDir: "dist",
29
+ emptyOutDir: false, // keep assets
30
+ rollupOptions: {
31
+ external: ["react", "react-dom"]
32
+ }
33
+ }
34
+ });
35
+
36
+ console.log("✅ Build finished!");
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "pankosmia-rcl",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "private": false,
5
5
  "homepage": "/clients/core-client-rcl",
6
- "main": "build/pankosmia-rcl.umd.js",
7
- "module": "build/pankosmia-rcl.es.js",
8
-
6
+ "main": "dist/pankosmia-rcl.umd.js",
7
+ "module": "dist/pankosmia-rcl.es.js",
8
+ "type": "module",
9
9
  "dependencies": {
10
10
  "notistack": "^3.0.1",
11
11
  "pithekos-lib": "^0.11.4",
@@ -25,7 +25,7 @@
25
25
  "react-dom": "^17.0.0 || ^18.0.0"
26
26
  },
27
27
  "scripts": {
28
- "build": "vite build",
28
+ "build": "node build.js",
29
29
  "build:vite": "vite build",
30
30
  "build:package": "vite build",
31
31
  "dev": "vite",