I'm trying to exclude ace-build from a webpack bundle and load it via CDN. My problem is that react-ace always imports it, even if getAceInstance() correctly detects that we are under the CDN scenario.
Hey have you found a solution yet for using react-ace with a CDN-provided ace build? I also just stumbled across this, might bring massive build time and size optimizations
Problem
I'm trying to exclude ace-build from a webpack bundle and load it via CDN. My problem is that
react-ace
always imports it, even ifgetAceInstance()
correctly detects that we are under the CDN scenario.The core of the problem seems to be this usage of Range here. https://github.com/securingsincity/react-ace/blob/7709bf27699b33bdba91b46a2a6b1aacc5f1aa64/src/ace.tsx#L1 and here: https://github.com/securingsincity/react-ace/blob/7709bf27699b33bdba91b46a2a6b1aacc5f1aa64/src/ace.tsx#L538
I believe this should be changed to ace.Range.
Also, changing all the imports to
import type
would highlight this problems and make sure thatace-builds
is not included accidentally. For example:Sample code to reproduce your issue
Just import the library in create-react-app.
References
Progress on: #