Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion kbn_pm/src/commands/build_shared_packages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { run } from '../lib/spawn.mjs';

/** @type {import("../lib/command").Command} */
/** @type {import('../lib/command').Command} */
export const command = {
name: 'build-shared',
intro: 'Builds shared packages with webpack',
Expand All @@ -35,6 +35,10 @@ export const command = {
[':build-webpack'].concat(!cache ? ['-u'] : []).concat(dist ? ['--', '--dist'] : []),
{
pipe: !quiet,
env: {
...process.env,
...(!cache ? { MOON_CACHE: 'off' } : {}),
},
}
);

Expand Down
17 changes: 15 additions & 2 deletions src/dev/build/tasks/build_packages_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export const BuildPackages: Task = {
await buildWebpackBundles({
quiet: false,
dist: true,
noCache: true,
});

const transformConfig: TransformConfig = {
Expand Down Expand Up @@ -307,8 +308,20 @@ export const BuildPackages: Task = {
},
};

export async function buildWebpackBundles({ quiet, dist }: { quiet: boolean; dist: boolean }) {
const options = [quiet ? ['--quiet'] : [], dist ? ['--dist'] : []].flat();
export async function buildWebpackBundles({
quiet,
dist,
noCache,
}: {
quiet: boolean;
dist: boolean;
noCache?: boolean;
}) {
const options = [
quiet ? ['--quiet'] : [],
dist ? ['--dist'] : [],
noCache ? ['--no-cache'] : [],
].flat();
const stdio: StdioOption[] = quiet
? ['ignore', 'pipe', 'pipe']
: ['inherit', 'inherit', 'inherit'];
Expand Down