SAP/ui5-tooling

Add ability to configure behavior of predefined tasks

dfenerski opened this issue · 5 comments

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

For big enterprises running internal apps it may be helpful to have debug / source map files on prod. Sometimes however this behavior is not optimal. If the front-end code should be considered some form of ""intellectual property"", availability of only obfuscated files in the browser is a good scenario.

In v2 the createDebugFiles could be switched off. In v3 minify now handles generation of such files. And to disable debug file generation means to skip the whole minification process.

AFAIK predefined tasks / tasks in general accept no "arguments" that may influence their behavior.

Describe the solution you'd like

Tasks / predefined tasks / minify should be able to accept arguments specifying whether source maps / debug files should be generated.

Describe alternatives you've considered

One can edit the source code here and adjust the behavior. Tool such as the npm package patch-package can be used to persist any such changes. This is however very inflexible and requires maintenance.

Additional context

I think such functionality would be helpful. Please let me now if I am missing something here / this is already covered in some way.

Thanks & BR

I am unsure of this, but I think the v3 is used to build the demo kit. The issue can be demonstrated there. As part of SAPUI5 only, some controls are not available for general use. However if one opens the sample page of such control e.g this one in the sources tab of the dev tools the raw source code can be seen:
image

Thank you for your input. Indeed, there is currently no configuration option to to disable source map generation for all projects in a build.

In the future, we plan to enhance UI5 Tooling with capabilities such as consuming pre-built libraries and caching build results. Giving projects more control over how dependencies are built would defeat the benefits of such enhancements. But of course I see your point and find this a reasonable feature request we might implement in the future.

For the time being, you can try using a custom task in your root project and filter out debug- and source map files using tags.