plaiceholder icon indicating copy to clipboard operation
plaiceholder copied to clipboard

Base folder for options (for nx with nextjs)

Open gabeszrozsa opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. I'm using nx with nextjs and my folder structure is different than the original. It's a monorepo, and the public folder in nested inside many levels. Example:

happynrwl/
├── apps
│   ├── tuskdesk
│   │   ├── index.d.ts
│   │   ├── jest.config.js
│   │   ├── next-env.d.ts
│   │   ├── next.config.js
│   │   ├── pages
│   │   │   ├── _app.tsx
│   │   │   ├── index.module.css
│   │   │   ├── index.tsx
│   │   │   └── styles.css
│   │   ├── public <--- public is not inside the root folder

Please see: https://nx.dev/l/r/guides/nextjs

Describe the solution you'd like I'd like to have an optional baseFolder prop (name can be different of course) for the IGetPlaiceholderOptions, where I can override the hard coded ./public for images https://github.com/joe-bell/plaiceholder/blob/67ed723f8ea0b8ad43d627477040b1db135d54cb/packages/plaiceholder/src/get-image.ts#L105

Describe alternatives you've considered Currently the workaround is to have two public folders: one in my root and one inside the nextjs project's root.

Additional context Thank you for this wonderful plugin, I really appreciate your work!

gabeszrozsa avatar Oct 16 '21 20:10 gabeszrozsa

Hey! Sounds like a reasonable feature request – I think my preference would be a publicDir prop

Unfortunately, I'm pretty strapped for time at the moment so I'll leave this issue open if others wish to contribute in the meantime

joe-bell avatar Oct 18 '21 08:10 joe-bell