@mpxjs/webpack-plugin 2.8.25-alpha → 2.8.25-alpha.2
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/loader.js +3 -1
- package/lib/tenon/processScript.js +11 -4
- package/package.json +2 -2
package/lib/loader.js
CHANGED
|
@@ -70,7 +70,9 @@ module.exports = function (content) {
|
|
|
70
70
|
|
|
71
71
|
if (ctorType === 'app') {
|
|
72
72
|
const appName = getEntryName(this)
|
|
73
|
-
|
|
73
|
+
if (appName) {
|
|
74
|
+
this._module.addPresentationalDependency(new AppEntryDependency(resourcePath, appName))
|
|
75
|
+
}
|
|
74
76
|
}
|
|
75
77
|
const loaderContext = this
|
|
76
78
|
const stringifyRequest = r => loaderUtils.stringifyRequest(loaderContext, r)
|
|
@@ -5,6 +5,7 @@ const normalize = require('../utils/normalize')
|
|
|
5
5
|
const builtInLoaderPath = normalize.lib('built-in-loader')
|
|
6
6
|
const optionProcessorPath = normalize.lib('runtime/optionProcessor')
|
|
7
7
|
const createJSONHelper = require('../json-compiler/helper')
|
|
8
|
+
const createHelpers = require('../helpers')
|
|
8
9
|
const async = require('async')
|
|
9
10
|
const hasOwn = require('../utils/has-own')
|
|
10
11
|
|
|
@@ -89,6 +90,8 @@ module.exports = function (script, options, callback) {
|
|
|
89
90
|
emitError
|
|
90
91
|
})
|
|
91
92
|
|
|
93
|
+
const { getRequire } = createHelpers(loaderContext)
|
|
94
|
+
|
|
92
95
|
const stringifyRequest = r => loaderUtils.stringifyRequest(loaderContext, r)
|
|
93
96
|
// let tabBarPagesMap = {}
|
|
94
97
|
// if (tabBar && tabBarMap) {
|
|
@@ -188,10 +191,14 @@ module.exports = function (script, options, callback) {
|
|
|
188
191
|
if (!isProduction) {
|
|
189
192
|
content += ` global.currentResource = ${JSON.stringify(loaderContext.resourcePath)}\n`
|
|
190
193
|
}
|
|
191
|
-
//
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
:
|
|
194
|
+
// 传递ctorType以补全js内容
|
|
195
|
+
const extraOptions = {
|
|
196
|
+
ctorType,
|
|
197
|
+
lang: script.lang || 'js'
|
|
198
|
+
}
|
|
199
|
+
// 使用 require 引入 script
|
|
200
|
+
content += ` ${getRequire('script', script, extraOptions)}\n`
|
|
201
|
+
|
|
195
202
|
// createApp/Page/Component执行完成后立刻获取当前的option并暂存
|
|
196
203
|
content += ` const currentOption = global.__mpxOptionsMap[${JSON.stringify(moduleId)}]\n`
|
|
197
204
|
// 获取pageConfig
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/webpack-plugin",
|
|
3
|
-
"version": "2.8.25-alpha",
|
|
3
|
+
"version": "2.8.25-alpha.2",
|
|
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": "
|
|
88
|
+
"gitHead": "8f3578d8728e77c8666d431de97c45a2736482c1"
|
|
89
89
|
}
|