@mpxjs/webpack-plugin 2.8.23-alpha → 2.8.23-alpha.1

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.
@@ -29,6 +29,7 @@ module.exports = function (script, options, callback) {
29
29
  const localPagesMap = options.localPagesMap
30
30
  const srcMode = options.srcMode
31
31
  const loaderContext = options.loaderContext
32
+ const moduleId = options.moduleId
32
33
  const isProduction = options.isProduction
33
34
  const componentId = options.componentId
34
35
  // const i18n = options.i18n
@@ -182,7 +183,7 @@ module.exports = function (script, options, callback) {
182
183
  const componentRequest = forceDisableBuiltInLoader ? stringifyRequest(componentCfg.resource) : stringifyRequest('builtInComponent.vue!=!' + builtInLoaderPath + '!' + componentCfg.resource)
183
184
  componentsMap[componentName] = `getComponent(require(${componentRequest}), { __mpxBuiltIn: true })`
184
185
  })
185
-
186
+ content += ` global.currentModuleId = ${JSON.stringify(moduleId)}\n`
186
187
  content += ` global.currentSrcMode = ${JSON.stringify(scriptSrcMode)}\n`
187
188
  if (!isProduction) {
188
189
  content += ` global.currentResource = ${JSON.stringify(loaderContext.resourcePath)}\n`
@@ -192,7 +193,7 @@ module.exports = function (script, options, callback) {
192
193
  ? `require(${stringifyRequest(script.src)})\n`
193
194
  : (script.content + '\n') + '\n'
194
195
  // createApp/Page/Component执行完成后立刻获取当前的option并暂存
195
- content += ' const currentOption = global.currentOption\n'
196
+ content += ` const currentOption = global.__mpxOptionsMap[${JSON.stringify(moduleId)}]\n`
196
197
  // 获取pageConfig
197
198
  const pageConfig = {}
198
199
  if (ctorType === 'page') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.8.23-alpha",
3
+ "version": "2.8.23-alpha.1",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -85,5 +85,5 @@
85
85
  "engines": {
86
86
  "node": ">=14.14.0"
87
87
  },
88
- "gitHead": "3a6dff432fd46bab36a9866f92cffb6501e69909"
88
+ "gitHead": "7c267ed965671fa83836ab099c3ccac59d69baa3"
89
89
  }