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

fix(manifest): include assets referenced in html #14657

Merged
merged 1 commit into from
Oct 18, 2023
Merged

Conversation

ArnaudBarre
Copy link
Member

Discovered by hasard while doing #14643 (required to make tests pass)

@ArnaudBarre ArnaudBarre self-assigned this Oct 16, 2023
@sapphi-red sapphi-red added the p3-minor-bug An edge case that only affects very specific usage (priority) label Oct 17, 2023
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

Would you add a test here that ensures the asset only referenced in html is included in the manifest?

test.runIf(isBuild)('manifest', async () => {
const manifest = readManifest('foo')
const entry = manifest['index.html']
for (const file of listAssets('foo')) {
if (file.endsWith('.css')) {
expect(entry.css).toContain(`assets/${file}`)
} else if (!file.endsWith('.js')) {
expect(entry.assets).toContain(`assets/${file}`)
}
}
})

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny nit: could we use an svg so it's smaller?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My next PR will make SVG be inline.
But I can use a new SVG and reduce the inlineSize now, but this requires a new config test because the default one is already increase to 8kb (why I used ~12kb one)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok if it's specifically to pass the 8kb limit, and there's no existing files to use I'm fine with it then. No need to change 👍

@ArnaudBarre
Copy link
Member Author

@sapphi-red you're suggesting adding a new test with a html + asset file only and duplicate this test?
The linked test is actually failing with the playground change without the code

@sapphi-red
Copy link
Member

My bad, I misunderstood the test.

@bluwy bluwy merged commit f627b91 into main Oct 18, 2023
9 checks passed
@bluwy bluwy deleted the arnaud/fix-manifest branch October 18, 2023 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants