Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return list of prerendered files from adapter utils #3099

Closed
geoffrich opened this issue Dec 23, 2021 · 1 comment
Closed

Return list of prerendered files from adapter utils #3099

geoffrich opened this issue Dec 23, 2021 · 1 comment
Labels
adapters - general Support for functionality general to all adapters feature request New feature or request

Comments

@geoffrich
Copy link
Member

Describe the problem

#2675 updated the prerender function to return a list of prerendered files. However, this list was not returned from the prerender function called from the adapter utils. See the code below: the internal prerender is called, but its return value is not used. This means the adapter can't access it.

async prerender({ all = false, dest, fallback }) {
await prerender({
out: dest,
all,
cwd,
config,
build_data,
fallback,
log
});
}

I think this was missed since #2674 did return the list of copied files from the adapter utils, but let me know if it was intentional.

Describe the proposed solution

Return the list of prerendered files from the adapter utils. This will allow adapter authors to know what files have been prerendered.

Alternatives considered

No response

Importance

nice to have

Additional Information

I maintain the Azure SWA adapter, and want to know if index.html was prerendered or not.

@bluwy bluwy added adapters - general Support for functionality general to all adapters feature request New feature or request labels Dec 25, 2021
@geoffrich
Copy link
Member Author

Looks like this was fixed in the adapter API overhaul in #2931.

async prerender({ all = false, dest, fallback }) {
if (generated_manifest) {
throw new Error(
'Adapters must call prerender(...) before createEntries(...) or generateManifest(...)'
);
}
const prerendered = await prerender({
out: dest,
all,
cwd,
config,
build_data,
fallback,
log
});
prerendered.paths.forEach((path) => {
prerendered_paths.add(path);
prerendered_paths.add(path + '/');
});
return prerendered;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters - general Support for functionality general to all adapters feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants