Skip to content

Commit

Permalink
fix(mini-runner): 修复独立分包场景下 jsonpFunction 配置和 base.wxml 引用路径问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xing240 authored and Chen-jj committed Apr 12, 2022
1 parent 09d5e61 commit a510b90
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/taro-mini-runner/src/plugins/MiniPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,8 @@ export default class TaroMiniPlugin {
if (independentPackages.size) {
independentPackages.forEach((pages, name) => {
const childCompiler = compilation.createChildCompiler(PLUGIN_NAME, {
path: `${compiler.options.output}/${name}`
path: `${compiler.options.output.path}/${name}`,
jsonpFunction: `${compiler.options.output.jsonpFunction}/${name}`
})
const compPath = path.resolve(__dirname, '..', 'template/comp')
childCompiler.inputFileSystem = compiler.inputFileSystem
Expand Down Expand Up @@ -971,14 +972,15 @@ export default class TaroMiniPlugin {
}
})
this.pages.forEach(page => {
const importBaseTemplatePath = promoteRelativePath(path.relative(page.path, path.join(sourceDir, this.getTemplatePath(baseTemplateName))))
let importBaseTemplatePath = promoteRelativePath(path.relative(page.path, path.join(sourceDir, this.getTemplatePath(baseTemplateName))))
const config = this.filesConfig[this.getConfigFilePath(page.name)]
let isIndependent = false
let independentName = ''
this.independentPackages.forEach((pages, name) => {
if (pages.includes(page.path)) {
isIndependent = true
independentName = name
importBaseTemplatePath = promoteRelativePath(path.relative(page.path, path.join(sourceDir, name, this.getTemplatePath(baseTemplateName))))
}
})
if (config) {
Expand Down

0 comments on commit a510b90

Please sign in to comment.