ui5-tooling icon indicating copy to clipboard operation
ui5-tooling copied to clipboard

Add ability to configure behavior of predefined tasks

Open dfenerski opened this issue 2 years ago • 4 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

dfenerski avatar Mar 24 '23 14:03 dfenerski

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.

RandomByte avatar Apr 14 '23 14:04 RandomByte

Hello, do you have any updates regarding this change? This is a crucial issue as UI5 Tooling currently requires version 3.X, and debug files are consistently being generated.

Thanks

allosmt avatar Nov 05 '23 13:11 allosmt

@allosmt would a custom task, as proposed by @RandomByte, be a solution for your use case?

matz3 avatar Nov 06 '23 14:11 matz3

Hi @matz3 , Thank you for getting back to me. The proposed solution is fit as a temporary measure. However, I am required to migrate the project to UI Tooling V3, and it would be greatly appreciated if the new V3 version could offer as well as new features, at least, the same configuration options as the previous version. Thanks

allosmt avatar Nov 06 '23 20:11 allosmt

For anyone interested, this task is on npm now: https://www.npmjs.com/package/ui5-task-no-debug-files.

dfenerski avatar Feb 22 '24 14:02 dfenerski