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

feat(service/runner): 小程序config配置支持entryFileName指定入口文件(#7187) #7192

Closed
wants to merge 7 commits 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
3 changes: 2 additions & 1 deletion packages/taro-mini-runner/src/plugins/MiniPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,9 @@ export default class TaroMiniPlugin {
*/
getAppEntry (compiler: webpack.Compiler) {
const originalEntry = compiler.options.entry as webpack.Entry
const entryFileName = Object.keys(originalEntry)[0]
compiler.options.entry = {}
return path.resolve(this.context, originalEntry.app[0])
return path.resolve(this.context, originalEntry[entryFileName]?.[0])
}

getChangedFiles (compiler) {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-service/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class Config {
const sourceDirName = initialConfig.sourceRoot || SOURCE_DIR
const outputDirName = initialConfig.outputRoot || OUTPUT_DIR
const sourceDir = path.join(this.appPath, sourceDirName)
const entryName = ENTRY
const entryName = initialConfig.entryFileName || ENTRY
const entryFilePath = resolveScriptPath(path.join(sourceDir, entryName))

const entry = {
Expand Down