mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
chore(NA): restore needed step in order to compile x-pack with typescript.
This commit is contained in:
parent
577e165ffa
commit
1a14a64fc4
1 changed files with 25 additions and 0 deletions
|
@ -4,12 +4,22 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import del from 'del';
|
||||
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';
|
||||
|
||||
async function moveFiles(gulp, src, dest) {
|
||||
return new Promise((resolve, reject) => {
|
||||
gulp.src(src)
|
||||
.pipe(gulp.dest(dest))
|
||||
.on('finish', resolve)
|
||||
.on('error', reject);
|
||||
});
|
||||
}
|
||||
|
||||
export default (gulp, { buildTarget }) => {
|
||||
gulp.task('build', ['clean', 'report', 'prepare:build'], async () => {
|
||||
const buildRoot = resolve(buildTarget, 'kibana/x-pack');
|
||||
|
@ -18,6 +28,21 @@ export default (gulp, { buildTarget }) => {
|
|||
buildDestination: buildTarget,
|
||||
});
|
||||
|
||||
// NOTE: In order to prevent ending up with transpiled js files
|
||||
// in the repository, we have set the outDir on x-pack tsconfig file
|
||||
// to be the same as the intermediateBuildDirectory defined on the package.json
|
||||
// As result of it, we need to move the transpiled js files for the correct folder
|
||||
// and in the end deleting the generated outDir from the intermediateBuildDirectory.
|
||||
//
|
||||
//# TODO: This might be able to go away as soon as we upgrade the x-pack build to use babel7
|
||||
await moveFiles(
|
||||
gulp,
|
||||
resolve(buildRoot, 'x-pack/build/plugin/kibana/x-pack/**/!(*.test).js'),
|
||||
buildRoot
|
||||
);
|
||||
await del(resolve(buildRoot, 'x-pack'));
|
||||
//#
|
||||
|
||||
const log = new ToolingLog({
|
||||
level: 'info',
|
||||
writeTo: process.stdout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue