- Edited
Do we still have a 'sister site' for JS stuff?
I really want to complain about the fact that you can't do a module import from anything but a quoted string...
Do we still have a 'sister site' for JS stuff?
I really want to complain about the fact that you can't do a module import from anything but a quoted string...
Are you trying to do dynamic imports? Or is there another goal?
Thanks for the link. "coerced from a string" is helpful. Firefox (devel browser of necessity due to certificate issues with the devel site at the moment) had docs that said "only a string was acceptable" and I was needing to alter the path based on a PHP config variable. Fortunately the relative path to DOCROOT was the same both places so that worked:
import foobar from '/js/json/foo.js'
I was afraid CORS would block, but it seems to be okay.
dalecosp Firefox (devel browser of necessity due to certificate issues with the devel site at the moment)
I prefer Firefox.
dalecosp was needing to alter the path based on a PHP config variable.
This is a bit confusing. Can you not just output the PHP string in your JS like so:
import foobar from <?php echo $my_path_var; ?>;
?