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

generateSW() result doesn't match the docs #3382

Open
HazzMan2409 opened this issue Dec 4, 2024 · 1 comment
Open

generateSW() result doesn't match the docs #3382

HazzMan2409 opened this issue Dec 4, 2024 · 1 comment

Comments

@HazzMan2409
Copy link

HazzMan2409 commented Dec 4, 2024

When using workbox-build I assumed looking at the docs that I would be able to get information about what will be pre-cache from the generateSW() result. See https://developer.chrome.com/docs/workbox/modules/workbox-build#generatesw_mode

When I call generateSW() I get output that looks like:

filePaths: [
    '<path_to_service_worker>.js.map',
    '<path_to_service_worker>.js',
    '<path_to_workbox_script>.js.map',
    '<path_to_workbox_script>.js'
  ],
  count: 4,
  size: 5653385,
  warnings: []

Is this expected behavior? If so the docs need changed.

@tobigiwa
Copy link

tobigiwa commented Dec 6, 2024

from the typescript docs...

export declare function generateSW(config: GenerateSWOptions): Promise<BuildResult>;

export interface GetManifestResult {
    count: number;
    manifestEntries: Array<ManifestEntry>;
    size: number;
    warnings: Array<string>;
}
export type BuildResult = Omit<GetManifestResult, 'manifestEntries'> & {
    filePaths: Array<string>;
};

so, i guess you're good, man. hey, please take a look at my questions on the stackoverflow... i've been crying to everyone i think knows workbox to help me, no answers. My job greatly depends on this (cos i was the idiot who pitched, i can use workbox to achieve this).

https://stackoverflow.com/questions/79240111/the-browser-says-the-sw-is-activated-and-running-but-it-never-answers-to-any-r

https://stackoverflow.com/questions/79248372/error-generatesw-must-have-required-property-swdest-but-property-is-presen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants