@opennextjs/cloudflare 0.0.0-5454280

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/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ Copyright (c) 2020 Cloudflare, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any
4
+ person obtaining a copy of this software and associated
5
+ documentation files (the "Software"), to deal in the
6
+ Software without restriction, including without
7
+ limitation the rights to use, copy, modify, merge,
8
+ publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software
10
+ is furnished to do so, subject to the following
11
+ conditions:
12
+
13
+ The above copyright notice and this permission notice
14
+ shall be included in all copies or substantial portions
15
+ of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
18
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
20
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
21
+ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
24
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25
+ DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # Next.js builder for Cloudflare
2
+
3
+ ## Build your app
4
+
5
+ - update the `next.config.mjs` as follows
6
+
7
+ ```typescript
8
+ /** @type {import('next').NextConfig} */
9
+ const nextConfig = {
10
+ output: "standalone",
11
+ experimental: {
12
+ serverMinification: false,
13
+ },
14
+ };
15
+
16
+ export default nextConfig;
17
+ ```
18
+
19
+ - add the following `devDependency` to the `package.json`:
20
+
21
+ ```json
22
+ "node-url": "npm:url@^0.11.4",
23
+ "wrangler": "^3.77.0"
24
+ ```
25
+
26
+ - Execute `npx @flarelabs-net/builder@latest` in your app folder
27
+
28
+ ## Serve your app
29
+
30
+ - add a `wrangler.toml` at the root of your project
31
+
32
+ ```toml
33
+ #:schema node_modules/wrangler/config-schema.json
34
+ name = "<app-name>"
35
+ main = ".worker-next/index.mjs"
36
+
37
+ compatibility_date = "2024-08-29"
38
+ compatibility_flags = ["nodejs_compat_v2"]
39
+ workers_dev = true
40
+ minify = false
41
+
42
+ # Use the new Workers + Assets to host the static frontend files
43
+ experimental_assets = { directory = ".worker-next/assets", binding = "ASSETS" }
44
+ ```
45
+
46
+ - Use `wrangler dev`