Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改 项目配置文件中可以修改输出目录,重新 build 时的默认清空目录 #2024

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/taro-cli/bin/taro-build
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ console.log(chalk.green(`开始编译项目 ${chalk.bold(projectConf.projectName
build(args, {
type,
watch
})
}, projectConf)
4 changes: 2 additions & 2 deletions packages/taro-cli/src/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const CONFIG = require('./config')

const appPath = process.cwd()

function build (args, buildConfig) {
function build (args, buildConfig, projectConf) {
const { type, watch } = buildConfig
const outputPath = path.join(appPath, CONFIG.OUTPUT_DIR)
const outputPath = path.join(appPath, projectConf.outputRoot || CONFIG.OUTPUT_DIR)
if (!fs.existsSync(outputPath)) {
fs.mkdirSync(outputPath)
} else {
Expand Down