Open HriBB opened 1 month ago
I was able to work around this issue by "fixing" and "unfixing" the package.json
befoe and after the web-image-gen
script like this:
"fix": "sed -i -e 's/\"type\": \"module\"/\"type\": \"commonjs\"/g' ./package.json",
"unfix": "sed -i -e 's/\"type\": \"commonjs\"/\"type\": \"module\"/g' ./package.json",
"web-image-gen": "npm run fix && web-image-gen generate --verbose && npm run unfix"
The above fix is a lame workaround. Instead, I just created a PR to allow .cjs
config file ;)
Hi @HriBB, thanks for the issues and PRs. Sorry for the slow reply. I'll dive in on these next week. Thanks.
No problem, take your time ;) I am testing out different approaches to responsive images and this library looks promising ;)
I am using latest remix which uses
"type": "module"
in package.json. When I run web-image-gen I get this error.Script works perfectly if I change to
"type": "commonjs"
.I also tried using
--config .web-image-gen.cjs
but it accepts only.js
or.json
Maybe if I find some time, I can make a PR, but no promises.
Cool tool BTW ;)