Inline icon indicating copy to clipboard operation
Inline copied to clipboard

File filtering doesn't work as expected.

Open microrony opened this issue 1 year ago • 3 comments

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",
		]
	})
],

microrony avatar Jan 13 '25 04:01 microrony

Thanks, we'll take a look.

NikolaRHristov avatar Jan 13 '25 04:01 NikolaRHristov

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");
			},
		],
	})
],

NikolaRHristov avatar Jan 13 '25 07:01 NikolaRHristov

Thank you so much @NikolaRHristov, that worked!

microrony avatar Jan 13 '25 07:01 microrony