The UI5 tooling V3 always generates -dbg.js
& .js.map
files, with no option to remove them. While helpful for debugging purposes, this behavior is sometimes undesirable.
Unfortunately the tooling has no native support for disabling this. However ui5-task-no-debug-files
plugs this gap. By installing this task, your final bundles will only contain the files you want.
- Requires at least
@ui5/[email protected]
(to supportspecVersion: "3.0"
)
- Start by installing the task as
devDependency
npm install ui5-task-no-debug-files --save-dev
- Enable the task in your project's
ui5.yaml
builder:
customTasks:
- name: ui5-task-no-debug-files
afterTask: generateComponentPreload
The task has a couple of options available which determine which files get omitted. Tweak those to achieve desired build output.
omitDbgFiles
- whether to filter-dbg.js
files from the output. Defaults totrue
omitSourceMapFiles
- whether to filter.js.map
files from the output. Defaults totrue
omitTSFiles
- whether to filter.ts
files from the output. Useful when developing in TypeScript setup. Defaults totrue
omitNonBundled
- whether to filter the original.js/.xml
files from the output. Defaults totrue
omitDirs
- Additional directories to be filtered out from the build output. Defaults to['test', 'i18n']
preserveNonBundled
- List of glob patterns to be explicitly kept in the output. Useful when aself-contained
build fails to bundle everything (e.g. it does not bundle lazy loaded fragments)
builder:
customTasks:
- name: ui5-tooling-transpile-task
afterTask: replaceVersion
- name: ui5-task-no-debug-files
afterTask: generateComponentPreload
configuration:
omitDbgFiles: false
omitSourceMapFiles: false
omitNonBundled: false
omitTSFiles: false
omitDirs: []
builder:
customTasks:
- name: ui5-tooling-transpile-task
afterTask: replaceVersion
- name: ui5-task-no-debug-files
afterTask: generateLibraryPreload
configuration:
omitDirs: []
preserveNonBundled: ['**/*.xml']
- When building libraries,
ui5-task-no-debug-files
should run aftergenerateLibraryPreload
- When building applications,
ui5-task-no-debug-files
should run- after
generateComponentPreload
if build is notself-contained
- after
generateStandaloneAppBundle
if build isself-contained
- after
This work is licensed under Apache 2.0.