question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exclude option in build configuration being ignored

See original GitHub issue

Expected Behavior

Shall not include excluded resources in build.

Current Behavior

Although excluded in configuration, resource is still being considered during build process.

Steps to reproduce the issue

  1. Clone and checkout minimal sample project git clone -b bundle-conf https://github.com/BenReim/openui5-sample-app.git

  2. Run build npm install && ui5 build --a

  3. Watch build log output referring to excluded resource WARN lbt:bundle:Builder **** warning: module sap/ui/demo/todo/scripts/mockserver.js requires top level scope and can only be embedded as a string (requires 'eval')

Log Output / Stack Trace

> ui5 build --a
info builder:builder Building project openui5-sample-app including dependencies...
info builder:builder �   (1/1) Building project openui5-sample-app
info builder:builder application openui5-sample-app � (1/9) Running task escapeNonAsciiCharacters...
info builder:builder application openui5-sample-app � (2/9) Running task replaceCopyright...
info builder:builder application openui5-sample-app � (3/9) Running task replaceVersion...
info builder:builder application openui5-sample-app � (4/9) Running task generateFlexChangesBundle...
info builder:builder application openui5-sample-app � (5/9) Running task generateComponentPreload...
WARN lbt:bundle:Builder **** warning: module sap/ui/demo/todo/scripts/mockserver.js requires top level scope and can only be embedded as a string (requires 'eval')
info builder:builder application openui5-sample-app � (6/9) Running task generateBundle...
info builder:builder application openui5-sample-app � (7/9) Running task createDebugFiles...
info builder:builder application openui5-sample-app � (8/9) Running task uglify...
info builder:builder application openui5-sample-app � (9/9) Running task generateVersionInfo...
info builder:builder Build succeeded in 604 ms
info builder:builder Executing cleanup tasks...

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
BenReimcommented, Apr 21, 2020

Hey - thanks for the explanation. It definitely makes sense now. 👍

IMHO such a check is not necessary. Though maybe the documentation could be enhanced a bit? I was expecting the use the full virtual paths as the samples in for the builder/resources/excludes option are all starting from /resources/.... The docu terms used (virtual, runtime paths) were not immediately clear too me.

Thanks for your work and all of the exiting features and enhancements that were brought with the tooling version 2! 😃

0reactions
RandomBytecommented, Apr 20, 2020

Hey, your exclude needs to be for the runtime path of the project as served by ui5-server. Opposing to @codeworrior comment, for projects of type application this means /scripts/** or /index.html since applications are always served on the root / and without their namespace.

We decided to align this with the Path Mapping of projects.

However, during ui5 build we transform the given exclude /scripts/** to the “virtual base path” /resources/sap/ui/demo/todo/scripts/** for further processing. In your case this led to the path /resources/sap/ui/demo/todo/resources/sap/ui/demo/todo/scripts/**.

We could check wether a given exclude already contains the full virtual base path and skip adding it again. This would allow for both styles. But I’m not sure whether this will make it easier or add more confusion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I exclude a file from a release build configuration?
Right-click on the file in the Project Explorer pane. Select "Resource Configurations" and "Exclude from build" and select the Release build.
Read more >
How to: Exclude projects from a build - Visual Studio (Windows)
On the menu bar, choose Build > Configuration Manager. · In the Project contexts table, locate the project you want to exclude from...
Read more >
Ignoring changes in dependency builds - IBM
Right-click the selected file or files and click Ignore Changes During Dependency Build. This message is displayed: Changes to the selected file(s) will...
Read more >
How to exclude/ignore a project(Dot Net) while configuring a ...
By default your project has a Release and a Debug configuration. (See Understanding Build Configurations). You can add a new configuration ...
Read more >
Ignoring files, folders, or code - Semgrep
An :include ... directive is added, which allows another file to be included in the ignore pattern list; typically this included file would...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found