Open irv-armenta-g opened 2 weeks ago
Thanks for opening this and sorry for the troubles which you have. I haven't tried this with pnpm but it looks like this might be the issue here as it works correctly with yarn or npm. I also haven't used the module programatically as you do.
One thing which comes into my mind is adding a new script under scripts
of your package.json
like this:
{
"scripts": {
"svg-sprite": "svg-symbol-sprite -i public/icons -c ./svgo.config.js"
}
}
and then execute it inside your script file like this
execSync(`pnpm run svg-sprite -o public/${svgSymbolsFileName}`, { stdio: 'inherit' });
Disclaimer: I haven't used pnpm and have no idea how it plays with stdio: 'inherit'
.
If this doesn't work maybe you can verify that actually pnpm
is causing the issues by temporarily switching to npm
or yarn
?
Let me know how this goes.
I am trying to use a custom config file (svgo.config.js) but it seems svg-symbol-sprite is unable to find it's location, even though it is in the same level as the script.
I have another project where I am using
yarn
and in that project it does seem to be working correctly.In this current project I am using
pnpm
as the package manager and script runner, I am usingtsx
to run a specific file in root calledgenerate-svg-icons.ts
This file uses
execSync
to call the inline CLI script, it's inside afs.readDir
call with other async functions in order to follow an order in execution.edit: I also have tried withouth
./
as it is stated should be "absolute" but I get the same result"I have tried so many ways, even using
path.resolve()
also tried adding the inline script in a separate script key and still I keep getting the same message:is this related to
pnpm
being the package manager? Information about my environment:generate-svg-icons.ts
andsvgo.config.js
both are in the same level at root./