kibana/x-pack/tasks/build.js
Tiago Costa 62453fe6c3
Replace tsc compilation with transpile with babel on kbn plugin helpers for typescript (#36769)
* chore(NA): add transpile with babel the typescript files on xpack when build.

* chore(NA): fix the globs for public folders inside server paths

* docs(NA): add comments to explain globs.

* chore(NA): use pipeline instead of async pipeline promise from dev utils. chore(NA): change globs definitions to match the overall convention.

* chore(NA): apply documented way to use stream pipeline.

* chore(NA): exclude test files from the build transpilation.

* chore(NA): add ignore for eslint complexity warning

* chore(na): fix bad added type files.

* fix(NA): unused type exports
2019-05-31 12:45:14 +01:00

36 lines
1 KiB
JavaScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { resolve } from 'path';
import { writeFileSync } from 'fs';
import pluginHelpers from '@kbn/plugin-helpers';
import { ToolingLog } from '@kbn/dev-utils';
import { generateNoticeFromSource } from '../../src/dev';
export default (gulp, { buildTarget }) => {
gulp.task('build', ['clean', 'report', 'prepare:build'], async () => {
await pluginHelpers.run('build', {
skipArchive: true,
buildDestination: buildTarget,
});
const buildRoot = resolve(buildTarget, 'kibana/x-pack');
const log = new ToolingLog({
level: 'info',
writeTo: process.stdout
});
writeFileSync(
resolve(buildRoot, 'NOTICE.txt'),
await generateNoticeFromSource({
productName: 'Kibana X-Pack',
log,
directory: buildRoot
})
);
});
};