packages/cli: clean dist dir before building

This commit is contained in:
Patrik Oldsberg
2020-06-05 01:20:00 +02:00
parent 576c8b07ab
commit 8edc391c06
@@ -14,6 +14,7 @@
* limitations under the License.
*/
import fs from 'fs-extra';
import { rollup, RollupOptions } from 'rollup';
import chalk from 'chalk';
import { relative as relativePath } from 'path';
@@ -83,5 +84,6 @@ async function build(config: RollupOptions) {
export const buildPackage = async (options: BuildOptions) => {
const configs = await makeConfigs(options);
await fs.remove(paths.resolveTarget('dist'));
await Promise.all(configs.map(build));
};