osdevisnot / sorvor

extremely fast, zero config server for modern web applications.
MIT License
81 stars 5 forks source link

Support for esbuild plugins #6

Open rajadain opened 3 years ago

rajadain commented 3 years ago

Hello,

Thank you for this project, it's very promising!

I'm working on a project has a number of SVG imports, and in the current webpack setup they are imported as SVGR:

import Prev2 from '../img/Prev2.svg';
import Prev from '../img/Prev.svg';
import Next2 from '../img/Next2.svg';
import Next from '../img/Next.svg';

esbuild does not support SVGs natively, however, there is a plugin for this: https://github.com/kazijawad/esbuild-plugin-svgr

Unfortunately, plugins cannot be configured through the esbuild CLI, and must be specified be specified in JavaScript or Go: https://github.com/evanw/esbuild/issues/111#issuecomment-657771160.

Is there a way I could use the SVGR plugin via sørvør?

Thanks!

osdevisnot commented 3 years ago

👋 Thank you for kind words @rajadain.

The SVGR plugin is authored and intended to be used with a JS build tools. I want to get to JS only plugins once the go api is flushed out and sorvor is little more stable.

I will keep this issue open to track the efforts and to hear ideas about the integration from anyone interested.

gunn4r commented 3 years ago

+1 for this. We'll fork for now and add to the plugins in go.