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

Not finding any files in my src directory #400

Open
Spleeding1 opened this issue Mar 4, 2022 · 1 comment
Open

Not finding any files in my src directory #400

Spleeding1 opened this issue Mar 4, 2022 · 1 comment

Comments

@Spleeding1
Copy link

I'm not sure what I'm doing wrong. Here is my code. I have one .png to test this out and it isn't working. I have tried multiple file paths, both relative and absolute. The variable that I am passing it is absolute. I am currently using Node 17.3.1.

import imagemin from "imagemin";
import imageminPngquant from "imagemin-pngquant";
import {assets} from "./paths.mjs";

async function process() {
	const files = await imagemin([`${assets.images}/*.{png}`], {
		destination: assets.images,
		plugins: [imageminPngquant()],
	});

	console.log(files);
}

process();

// output:
// []
@webketje
Copy link
Member

Your brace expansion pattern {png} is incorrect. If you only have png's just use *.png. If you need more use the brace expansion pattern with at least one comma: {png,jpg}.
See the test case here https://replit.com/@webketje/imagemin400

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