codesandbox-client icon indicating copy to clipboard operation
codesandbox-client copied to clipboard

Ability to host sandpack client at relative path

Open cryingpotat0 opened this issue 2 years ago • 2 comments

Hi there! I'm trying to self-host the codesandbox client (yarn build:sandpack) under a relative path in my domain. I want to do this to bypass some cross-origin iframe restrictions and interact with the compiled javascript code. I tried changing publicPath and setting CODESANDBOX_ROOT, but still ran into some things I had to manually patch. In particular I had to run the following sed commands (I hosted the client under the /www subpath):

yarn build:sandpack
LC_ALL=C find . -type f -exec sed -i '' 's/\/static/\/www\/static/g' {} +
LC_ALL=UTF-8 find . -type f -exec sed -i '' 's/\/babel-transpiler.e23522c3.worker.js/\/www\/babel-transpiler.e23522c3.worker.js/g' {} +

I'd imagine as I use more features (e.g. scss compilers) I'd have to run more sed commands which isn't ideal. Is there something I'm missing on how to do this? If not, could a way be added to host the sandpack client under a subdomain?

cryingpotat0 avatar Jan 07 '24 03:01 cryingpotat0

also come up into this issue

arcelan avatar Jan 09 '24 08:01 arcelan

+1

iampava avatar Apr 26 '24 18:04 iampava