Skip to content

Commit

Permalink
Return rollup input, output and result on buildCode
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloSzx committed Aug 25, 2022
1 parent 443c8d7 commit 89af531
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/eleven-jeans-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'bob-ts': patch
---

Return rollup input, output and result on `buildCode`
11 changes: 9 additions & 2 deletions packages/bob-ts/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ import { getRollupConfig } from './rollupConfig';

export async function buildCode(config: RollupConfig) {
const { rollup } = await import('rollup');
const { inputOptions, outputOptions } = await getRollupConfig(config);
const { inputOptions, outputOptions, input } = await getRollupConfig(config);

const build = await rollup(inputOptions);

await Promise.all(
const result = await Promise.all(
outputOptions.map(output => {
return build.write(output);
})
);

return {
result,
inputOptions,
outputOptions,
input,
};
}
1 change: 1 addition & 0 deletions packages/bob-ts/src/rollupConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,5 +378,6 @@ export const getRollupConfig = async ({
return {
inputOptions,
outputOptions,
input,
};
};

0 comments on commit 89af531

Please sign in to comment.