diff --git a/packages/taro-cli/src/build.ts b/packages/taro-cli/src/build.ts index cac80a351249..b6b678b8ada8 100644 --- a/packages/taro-cli/src/build.ts +++ b/packages/taro-cli/src/build.ts @@ -11,7 +11,7 @@ import { IBuildConfig } from './util/types' export default function build (appPath, buildConfig: IBuildConfig) { const { type, watch, platform, port, release } = buildConfig const configDir = require(path.join(appPath, PROJECT_CONFIG))(_.merge) - const outputPath = path.join(appPath, `${configDir.outputRoot || CONFIG.OUTPUT_DIR}/${type}`) + const outputPath = path.join(appPath, configDir.outputRoot || CONFIG.OUTPUT_DIR) if (!fs.existsSync(outputPath)) { fs.ensureDirSync(outputPath) } else if (type !== BUILD_TYPES.H5 && (type !== BUILD_TYPES.QUICKAPP || !watch)) { diff --git a/packages/taro-cli/src/h5/index.ts b/packages/taro-cli/src/h5/index.ts index 530580f6e51d..c1053d072014 100644 --- a/packages/taro-cli/src/h5/index.ts +++ b/packages/taro-cli/src/h5/index.ts @@ -86,7 +86,7 @@ class Compiler { this.projectConfig = projectConfig const sourceDir = projectConfig.sourceRoot || CONFIG.SOURCE_DIR this.sourceRoot = sourceDir - const outputDir = `${projectConfig.outputRoot || CONFIG.OUTPUT_DIR}/h5` + const outputDir = projectConfig.outputRoot || CONFIG.OUTPUT_DIR this.outputDir = outputDir this.h5Config = projectConfig.h5 const routerConfig = this.h5Config.router diff --git a/packages/taro-cli/src/mini/helper.ts b/packages/taro-cli/src/mini/helper.ts index 87ce0f3f3306..1f3b8b9f184d 100644 --- a/packages/taro-cli/src/mini/helper.ts +++ b/packages/taro-cli/src/mini/helper.ts @@ -105,7 +105,7 @@ export function setBuildData (appPath: string, adapter: BUILD_TYPES): IBuildData const configDir = path.join(appPath, PROJECT_CONFIG) const projectConfig = require(configDir)(_.merge) const sourceDirName = projectConfig.sourceRoot || CONFIG.SOURCE_DIR - const outputDirName = `${projectConfig.outputRoot || CONFIG.OUTPUT_DIR}/${adapter}` + const outputDirName = projectConfig.outputRoot || CONFIG.OUTPUT_DIR const sourceDir = path.join(appPath, sourceDirName) const outputDir = path.join(appPath, outputDirName) const entryFilePath = resolveScriptPath(path.join(sourceDir, CONFIG.ENTRY))