Expand description
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.
Constants§
Statics§
Functions§
- expand_
next_ js_ template - Given a next.js template file’s contents, replaces
replacementsandinjectionsand makes sure there are none left over. - expand_
next_ js_ template_ no_ imports - Same as
expand_next_js_template, but does not enforce that at least one relative import is present and rewritten. This is useful for very small templates that only use template variables/injections and have no imports of their own.