Skip to content

Remote URL is fetched anyway if saveRemote is false #312

@mvastola

Description

@mvastola

I'm running into an issue where a remote URL that I don't want saved is being fetched despite saveRemote being false.

It looks like this might have been intentional, but I'm not sure I understand why.

if (source.isRemote) {
// node-fetch is esm-only, so support cjs via import()
const fetch = (await import('node-fetch')).default;
const res = await fetch(/** @type { string } */ (source.sourcepath));
if (!res.ok) {
throw Error(
res.status === 404 ? 'Not found' : `Fetch error: ${res.status}`,
);
}

In my case, this is causing the entire operation to error out because the URL isn't accessible from the build machine where I run inline-source.

Is there any way to change this?

Or at least not bail when the request fails?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions