gtgalone / react-quilljs

React Hook Wrapper for Quill, powerful rich text editor.
https://www.npmjs.com/package/react-quilljs
MIT License
247 stars 28 forks source link

compatibility issue with ViteJS and other esbuild based bundler #56

Closed dohomi closed 2 years ago

dohomi commented 2 years ago

As discussed with previous PRs require is not compatible with ViteJS and other esbuild bundlers https://github.com/gtgalone/react-quilljs/blob/master/index.ts#L86

It breaks the build and prevents from production bundling for example with ViteJS and Storybook

gtgalone commented 2 years ago

Hi! @dohomi

Could ask to VitaJS?

It might be from VitaJS or configuration

because this package is working well in all environments for now.

itsUndefined commented 2 years ago

I could try to investigate this over the weekend since I have a webpack build that fails on 1.3.2 ( fix for vite )

dohomi commented 2 years ago

I think the solution is following config for ViteJS:

build: {
 commonjsOptions: {
  transformMixedEsModules: true,
 },
}