[8.12] fix(NA): skip plugin-helpers assets optimization when no ui (#173703) (#173753)

# Backport

This will backport the following commits from `main` to `8.12`:
- [fix(NA): skip plugin-helpers assets optimization when no ui
(#173703)](https://github.com/elastic/kibana/pull/173703)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Tiago
Costa","email":"tiago.costa@elastic.co"},"sourceCommit":{"committedDate":"2023-12-20T14:44:33Z","message":"fix(NA):
skip plugin-helpers assets optimization when no ui (#173703)\n\nThis
fixes a bug where the asset optimization script will try to run\r\neven
when we don't have any ui plugin
generated.","sha":"891d79b9e7bbdab31a7f0df8f8ccd10f87fcf1c2","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","auto-backport","v8.10.5","v8.12.1","v8.13.0","v8.11.4"],"number":173703,"url":"https://github.com/elastic/kibana/pull/173703","mergeCommit":{"message":"fix(NA):
skip plugin-helpers assets optimization when no ui (#173703)\n\nThis
fixes a bug where the asset optimization script will try to run\r\neven
when we don't have any ui plugin
generated.","sha":"891d79b9e7bbdab31a7f0df8f8ccd10f87fcf1c2"}},"sourceBranch":"main","suggestedTargetBranches":["8.10","8.12","8.11"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.5","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.12","label":"v8.12.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/173703","number":173703,"mergeCommit":{"message":"fix(NA):
skip plugin-helpers assets optimization when no ui (#173703)\n\nThis
fixes a bug where the asset optimization script will try to run\r\neven
when we don't have any ui plugin
generated.","sha":"891d79b9e7bbdab31a7f0df8f8ccd10f87fcf1c2"}},{"branch":"8.11","label":"v8.11.4","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
This commit is contained in:
Kibana Machine 2023-12-20 10:55:58 -05:00 committed by GitHub
parent ced76befcb
commit c6dc1b8525
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,11 @@ import { TaskContext } from '../task_context';
const asyncPipeline = promisify(pipeline);
export async function brotliCompressBundles({ buildDir, log }: TaskContext) {
export async function brotliCompressBundles({ buildDir, log, plugin }: TaskContext) {
if (!plugin.manifest.ui) {
return;
}
const compressDir = Path.resolve(buildDir, 'target/public');
log.info(