mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
e7c04f670f
Thus far, it wasn't possible to use `require()` in a template file with
Webpack.
But I needed to add a `if(NEXT_RUNTIME !== "edge") { const x =
require("../../something"); }`
Turbopack doesn't do any regex rewrite hacks, so this just worked
Utilities for Next.js written without a dependency on turbo-tasks, allowing them to be shared with webpack and/or rspack codepaths. This crate must be compilable to WASM, so that it works in environments where no native bindings are available.
These utilities should not perform file IO directly, but instead accept files they depend on as arguments (preferred) or via async trait methods or callbacks (acceptable). Follow "sans-io" patterns where possible.