pub fn expand_next_js_template<'a>(
content: &str,
template_path: &str,
next_package_dir_path: &str,
replacements: impl IntoIterator<Item = (&'a str, &'a str)>,
injections: impl IntoIterator<Item = (&'a str, &'a str)>,
imports: impl IntoIterator<Item = (&'a str, Option<&'a str>)>,
) -> Result<String>
Expand description
Given a next.js template file’s contents, replaces replacements
and injections
and makes
sure there are none left over.
See packages/next/src/build/templates/
for examples.
Paths should be unix or node.js-style paths where /
is used as the path separator. They should
not be windows-style paths.