core icon indicating copy to clipboard operation
core copied to clipboard

Change location of prebundle build outputs

Open Jand42 opened this issue 5 months ago • 1 comments

Currently (WS9.1), for production-ready web projects, WebSharper skips generating one class per file outputs and instead creates prebundles to be processed by a JS bundler (like esbuild). These are placed in the directory created for the assembly: under build/Scripts/WebSharper/AssemblyName/ (assuming build is the output folder configured in wsconfig.json).

If there are any JS resource files also defined by the web project, there is no way to automatically tell apart in the esbuild.config.mjs script which outputs are to be processed and what to copy as is. Which means users will need to customize their scripts if they create a web template and then introduce resources.

Instead, it would be better if the build folder would contain the prebundles in the same location as to be in wwwroot, directly under build/Scripts/WebSharper/ without the assembly name. Then they would be neatly separated from any resource tied to an assembly.

Jand42 avatar Jul 04 '25 09:07 Jand42