Skip to content

Commit

Permalink
fix: copy after build finished
Browse files Browse the repository at this point in the history
  • Loading branch information
v8tenko committed Jun 29, 2023
1 parent 5109c6d commit 75d6c58
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions scripts/build.cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ const {compilerOptions: {target}} = require('../tsconfig.json');

const diplodocExtensions = Object.keys(dependencies).filter((name) => name.startsWith('@diplodoc'));

for (const [type, path] of Object.entries(client.src)) {
const dst = client.dst[type];

shell.cp('-f', path, dst);
}

const commonConfig = {
tsconfig: './tsconfig.json',
Expand All @@ -31,7 +26,7 @@ const builds = [
[['src/workers/linter/index.ts'], 'build/linter.js'],
];

builds.forEach(([entries, outfile]) => {
Promise.all(builds.map(([entries, outfile]) => {
const currentConfig = {
...commonConfig,
entryPoints: entries,
Expand All @@ -45,5 +40,13 @@ builds.forEach(([entries, outfile]) => {
currentConfig.external = diplodocExtensions;
}

esbuild.build(currentConfig);
return esbuild.build(currentConfig);
})).then(() => {
for (const [type, path] of Object.entries(client.src)) {
const dst = client.dst[type];

shell.cp('-f', path, dst);
}
});


0 comments on commit 75d6c58

Please sign in to comment.