You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 using tsx to run a specific file in root called generate-svg-icons.ts
This file uses execSync to call the inline CLI script, it's inside a fs.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:
SVG Symbol Sprite: SVGO configuration file not found. Using default SVGO configuration.
is this related to pnpm being the package manager?
Information about my environment:
OS: windows
NODE: v20.17.0
package manager: pnpm
script runner: tsx
generate-svg-icons.ts and svgo.config.js both are in the same level at root ./
The text was updated successfully, but these errors were encountered:
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:
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.
scriptex
changed the title
svg-symbol-sprite not getting/finding the config file
svg-symbol-sprite not getting/finding the config file when using pnpm
Sep 18, 2024
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./
The text was updated successfully, but these errors were encountered: