From a75ce85bd74f34cc4a8e966a6efc8206b1a13217 Mon Sep 17 00:00:00 2001 From: yarastqt Date: Fri, 24 Apr 2020 15:50:49 +0300 Subject: [PATCH] feat: add outDir option --- src/core/build.ts | 4 ++-- src/core/project-config.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/build.ts b/src/core/build.ts index f75be6f..cb175b2 100644 --- a/src/core/build.ts +++ b/src/core/build.ts @@ -30,8 +30,8 @@ export async function build(_options: Config): Promise { const result_to_write = formats[format](result, options) for (const file of result_to_write) { // TODO: build dir should be configurated - await ensureDir(resolve(process.cwd(), _options.rootDir, 'tokens')) - await writeFile(resolve(process.cwd(), _options.rootDir, 'tokens', file.fileName), file.content) + await ensureDir(resolve(process.cwd(), _options.outDir, 'tokens')) + await writeFile(resolve(process.cwd(), _options.outDir, 'tokens', file.fileName), file.content) } } } diff --git a/src/core/project-config.ts b/src/core/project-config.ts index 3c1cd6e..0d872ac 100644 --- a/src/core/project-config.ts +++ b/src/core/project-config.ts @@ -5,6 +5,7 @@ import { Platforms } from './platforms' export type Config = { src: string + outDir: string platforms: Platforms formats: { [key: string]: {