Skip to content

Commit

Permalink
fix(cli): 多端编译不再主动输出代码到对应平台目录
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed May 24, 2019
1 parent e425b57 commit b9b749f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/taro-cli/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-cli/src/h5/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-cli/src/mini/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

2 comments on commit b9b749f

@Eamonnzhang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder why remove this feature?

@crazcdll
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This change costs me hours to find this commit...

Please sign in to comment.