@asaleh37/ui-base 1.2.13 → 1.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asaleh37/ui-base",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Ahmed Saleh Mohamed",
@@ -0,0 +1,4 @@
1
+ // src/global-shim.ts
2
+ if (typeof global === 'undefined') {
3
+ (globalThis as any).global = globalThis;
4
+ }
package/vite.config.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { defineConfig } from "vite";
2
2
  import react from "@vitejs/plugin-react";
3
3
  import rollupNodePolyFill from "rollup-plugin-polyfill-node";
4
- import tsconfigPaths from "vite-tsconfig-paths";
5
- import path from "path";
4
+ import inject from "@rollup/plugin-inject";
6
5
 
7
6
  // https://vite.dev/config/
8
7
  export default defineConfig({
@@ -14,18 +13,13 @@ export default defineConfig({
14
13
  include: ["fbjs"],
15
14
  },
16
15
  build: {
17
- lib: {
18
- entry: path.resolve(__dirname, "src/index.ts"),
19
- },
20
16
  rollupOptions: {
21
- external: ["react", "react-dom"], // 👈 keep react peer
22
- plugins: [rollupNodePolyFill()],
23
- output: {
24
- globals: {
25
- react: "React",
26
- "react-dom": "ReactDOM",
27
- },
28
- },
17
+ plugins: [
18
+ rollupNodePolyFill(),
19
+ inject({
20
+ global: [require.resolve("./src/global-shim"), "global"], // Inject our shim
21
+ }),
22
+ ],
29
23
  },
30
24
  },
31
25
  server: {