enuchi / React-Google-Apps-Script

This is your boilerplate project for developing React apps inside Google Sheets, Docs, Forms and Slides projects. It's perfect for personal projects and for publishing complex add-ons in the Google Workspace Marketplace.
MIT License
1.34k stars 178 forks source link

support for import() ? #128

Closed addlistener closed 2 years ago

addlistener commented 2 years ago

When I tried using the asynchronous import, heres what I got in the console

image

And I can only see code.gs in the online editor

image
enuchi commented 2 years ago

Can you share the snippet where you are importing? It shouldn't be creating those 0.main.js files -- did you change any configuration?

enuchi commented 2 years ago

@jchnxu looking into this a bit more and don't believe dynamic importing will provide any benefit with this repo. Google Apps Scripts doesn't allow loading separate chunks -- it just loads a single html file at a time. The approach with this repo is to load all scripts inline into a single html file. This makes initial load time slower, but that is what is possible given the Google Apps Script environment. If you have any ideas on how to support dynamic imports I'm happy to hear them.