AngelMunoz / Perla

A cross-platform tool for unbundled front-end development that doesn't depend on Node or requires you to install a complex toolchain
https://perla-docs.web.app/
MIT License
131 stars 12 forks source link

Write import map directly to index.html #64

Closed AngelMunoz closed 2 years ago

AngelMunoz commented 2 years ago

Is your feature request related to a problem? Please describe.

I understand that, I'm just wondering if the import map needs to be a file on disk. Could it not be a part of the perla.jsonc and perla extracts the info and generates an endpoint for it to serve it. After building you would obviously want to have a separate file.

Describe the solution you'd like Rather than keeping the import map a separate file we could write it directly into a script node inside the index.html file we actually do that at runtime when serving the index file so we could just skip that part and do it straight in the index file

Describe alternatives you've considered Keep it as a separate file

Additional context Since browsers don't support external import maps (even with polyfills) it makes no sense to keep it as a separate file for now but in the eventuality external import maps are enabled we could look to either add support for both situations or revert back.

from https://github.com/AngelMunoz/perla-samples/issues/2

AngelMunoz commented 2 years ago

I gave this another shot, I think when we add support for the test command (#75) we will also need a separate import map, I don't think we will be able to support both things without a separate import map

I will close this issue for the moment, and try to come back after that issue is done