@mpxjs/webpack-plugin 2.9.55 → 2.9.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -897,6 +897,8 @@ class MpxWebpackPlugin {
897
897
  runtimeInfo: {},
898
898
  // 记录运行时组件依赖的运行时组件当中使用的基础组件 slot,最终依据依赖关系注入到运行时组件的 json 配置当中
899
899
  dynamicSlotDependencies: {},
900
+ // 模板引擎参数,用来检测模板引擎支持渲染的模板
901
+ dynamicTemplateRuleRunner: this.options.dynamicTemplateRuleRunner,
900
902
  // 依据 package 注入到 mpx-custom-element-*.json 里面的组件路径
901
903
  getPackageInjectedComponentsMap: (packageName = 'main') => {
902
904
  const res = {}
@@ -706,7 +706,8 @@ module.exports = function (content) {
706
706
  for (const root in subPackagesCfg) {
707
707
  const subPackageCfg = subPackagesCfg[root]
708
708
  // 分包不存在 pages,输出 subPackages 字段会报错
709
- if (subPackageCfg.pages.length) {
709
+ // tt模式下分包异步允许一个分包不存在 pages
710
+ if (subPackageCfg.pages.length || mode === 'tt') {
710
711
  if (!json.subPackages) {
711
712
  json.subPackages = []
712
713
  }
@@ -153,7 +153,6 @@ module.exports = function getSpec ({ warn, error }) {
153
153
  test: 'componentPlaceholder',
154
154
  ali: aliComponentPlaceholderFallback,
155
155
  swan: deletePath(),
156
- tt: deletePath(),
157
156
  jd: deletePath()
158
157
  },
159
158
  {
@@ -2492,6 +2492,10 @@ function processElement (el, root, options, meta) {
2492
2492
  return
2493
2493
  }
2494
2494
 
2495
+ if (runtimeCompile && options.dynamicTemplateRuleRunner) {
2496
+ options.dynamicTemplateRuleRunner(el, options, config[mode])
2497
+ }
2498
+
2495
2499
  if (rulesRunner && el._atModeStatus !== 'match') {
2496
2500
  currentEl = el
2497
2501
  rulesRunner(el)
@@ -76,7 +76,8 @@ module.exports = function (raw) {
76
76
  checkUsingComponents: matchCondition(resourcePath, mpx.checkUsingComponentsRules),
77
77
  globalComponents: Object.keys(mpx.usingComponents),
78
78
  forceProxyEvent: matchCondition(resourcePath, mpx.forceProxyEventRules) || runtimeCompile,
79
- hasVirtualHost: matchCondition(resourcePath, mpx.autoVirtualHostRules)
79
+ hasVirtualHost: matchCondition(resourcePath, mpx.autoVirtualHostRules),
80
+ dynamicTemplateRuleRunner: mpx.dynamicTemplateRuleRunner
80
81
  })
81
82
 
82
83
  if (meta.wxsContentMap) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.9.55",
3
+ "version": "2.9.56",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -86,5 +86,5 @@
86
86
  "engines": {
87
87
  "node": ">=14.14.0"
88
88
  },
89
- "gitHead": "8e2e9dace226d48a91ff2a6dc2175c0a3be11d55"
89
+ "gitHead": "4175767d6ccf695ced81c9c7ced5eccd80445929"
90
90
  }