diff options
author | 2021-11-11 11:21:47 -0800 | |
---|---|---|
committer | 2021-11-22 10:21:14 -0800 | |
commit | 46a8215092c3e0cd56703b6ceb3c5a939d53c35c (patch) | |
tree | d19d16ef8056060d87763bd50194d95e1d6a2ae5 | |
parent | 62694f0ee99fb44cb655b6ed671599156d0c10f4 (diff) | |
download | bun-46a8215092c3e0cd56703b6ceb3c5a939d53c35c.tar.gz bun-46a8215092c3e0cd56703b6ceb3c5a939d53c35c.tar.zst bun-46a8215092c3e0cd56703b6ceb3c5a939d53c35c.zip |
consolidate empty files / references to one empty.tsx
-rw-r--r-- | packages/bun-framework-next/empty.tsx (renamed from packages/bun-framework-next/index.js) | 2 | ||||
-rw-r--r-- | packages/bun-framework-next/package.json | 10 | ||||
-rw-r--r-- | packages/bun-framework-next/server-polyfills.tsx | 2 | ||||
-rw-r--r-- | packages/bun-framework-next/server.production.tsx | 0 |
4 files changed, 9 insertions, 5 deletions
diff --git a/packages/bun-framework-next/index.js b/packages/bun-framework-next/empty.tsx index bbf5800ce..14a7c49f6 100644 --- a/packages/bun-framework-next/index.js +++ b/packages/bun-framework-next/empty.tsx @@ -1 +1,3 @@ // Keep this file here so that main resolves correctly + +export {}; diff --git a/packages/bun-framework-next/package.json b/packages/bun-framework-next/package.json index 4c2ad494a..f82243b71 100644 --- a/packages/bun-framework-next/package.json +++ b/packages/bun-framework-next/package.json @@ -1,8 +1,8 @@ { "name": "bun-framework-next", "version": "12.0.5", - "main": "index.js", - "module": "index.js", + "main": "empty.tsx", + "module": "empty.tsx", "description": "Bun compatibility layer for Next.js v12.0.x", "scripts": { "test": "echo Worked", @@ -86,9 +86,9 @@ } }, "production": { - "client": "client.production.tsx", - "server": "server.production.tsx", - "fallback": "fallback.production.tsx", + "client": "empty.tsx", + "server": "empty.tsx", + "fallback": "empty.tsx", "css": "onimportcss" } } diff --git a/packages/bun-framework-next/server-polyfills.tsx b/packages/bun-framework-next/server-polyfills.tsx index 474ee6ec9..d34c08fc5 100644 --- a/packages/bun-framework-next/server-polyfills.tsx +++ b/packages/bun-framework-next/server-polyfills.tsx @@ -13,6 +13,7 @@ class URL { } } var onlyChildPolyfill = React.Children.only; + React.Children.only = function (children) { if (children && typeof children === "object" && children.length == 1) { return onlyChildPolyfill(children[0]); @@ -20,6 +21,7 @@ React.Children.only = function (children) { return onlyChildPolyfill(children); }; + globalThis.URL = URL; import { TextEncoder, TextDecoder } from "./text-encoder-polyfill"; diff --git a/packages/bun-framework-next/server.production.tsx b/packages/bun-framework-next/server.production.tsx deleted file mode 100644 index e69de29bb..000000000 --- a/packages/bun-framework-next/server.production.tsx +++ /dev/null |