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

Service Workers and Standalone files #128

Closed AngelMunoz closed 1 year ago

AngelMunoz commented 1 year ago

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

Currently there's no way to add service workers to the root of the project I had a buggy "copy files from root" workaround to allow this to work but that simply won't cut it as it can break things specially when they match a path that has fable sources, we need to find a different way to incluide standalone js files in the final output of the build

Describe the solution you'd like Allow the data-entry-point attribute to specify if a file is standalone or not e.g.

<!-- Entrypoint that will be processed as usual -->
<script data-entry-point type="module" src="./App.fs.js"></script>
<!-- Standalone file that will be processed by esbuild but it is not tied to any JS file -->
<script data-entry-point="standalone" type="module" src="./App.fs.js"></script>

Service/Web workers are the main push for this feature otherwise one can't build PWAs

In this case Perla should not emit the script tag with the standalone based entrypoint but will do so for the nomal entrypoint

Describe alternatives you've considered N/A

Additional context N/A

AngelMunoz commented 1 year ago

Released in beta 24