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

File filtering doesn't work as expected. #347

Closed
microrony opened this issue Jan 13, 2025 · 3 comments
Closed

File filtering doesn't work as expected. #347

microrony opened this issue Jan 13, 2025 · 3 comments
Assignees

Comments

@microrony
Copy link

microrony commented Jan 13, 2025

I am working on a pretty big website with almost 3k HTML so the build is taking way longer when I include every page and the build is failing. I am now trying to include only the homepage in the build. Which I thought maybe I could add easily with the Exclude option. But it seems like not working as I expected. Can you please let me know if this is a bug or if I am missing something here?

This completely ignores inlining CSS for the whole site.

integrations:  [
	playformInline({
		Exclude: [
			(File) => File !== "./dist/index.html",
		]
	})
],

And this inlines every page including "./dist/index.html".

integrations:  [
	playformInline({
		Exclude: [
			(File) => File === "./dist/index.html",
		]
	})
],
@NikolaRHristov
Copy link
Member

Thanks, we'll take a look.

@NikolaRHristov
Copy link
Member

This should work:

integrations:  [
	playformInline({
		Exclude: [
			(File) => {
				// Check the full path name
				console.log(File);
				
				// Ignore all files, but dist/index.html
				return !File.includes("dist/index.html");
			},
		],
	})
],

@microrony
Copy link
Author

Thank you so much @NikolaRHristov, that worked!

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

No branches or pull requests

2 participants