@mpxjs/webpack-plugin 2.6.114-alpha.8 → 2.6.115

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.
Files changed (129) hide show
  1. package/README.md +1 -1
  2. package/lib/built-in-loader.js +49 -0
  3. package/lib/config.js +0 -14
  4. package/lib/content-loader.js +13 -0
  5. package/lib/dependency/ChildCompileDependency.js +24 -0
  6. package/lib/dependency/InjectDependency.js +26 -0
  7. package/lib/dependency/RemovedModuleDependency.js +23 -0
  8. package/lib/{dependencies → dependency}/ReplaceDependency.js +2 -19
  9. package/lib/dependency/ResolveDependency.js +49 -0
  10. package/lib/extractor.js +178 -82
  11. package/lib/file-loader.js +19 -7
  12. package/lib/helpers.js +334 -39
  13. package/lib/index.js +525 -889
  14. package/lib/json-compiler/index.js +451 -245
  15. package/lib/json-compiler/{theme.js → theme-loader.js} +3 -5
  16. package/lib/loader.js +241 -178
  17. package/lib/native-loader.js +133 -71
  18. package/lib/parser.js +2 -1
  19. package/lib/path-loader.js +3 -0
  20. package/lib/platform/json/wx/index.js +1 -1
  21. package/lib/platform/template/normalize-component-rules.js +3 -2
  22. package/lib/platform/template/wx/component-config/button.js +2 -14
  23. package/lib/platform/template/wx/component-config/image.js +0 -4
  24. package/lib/platform/template/wx/component-config/input.js +0 -4
  25. package/lib/platform/template/wx/component-config/rich-text.js +0 -4
  26. package/lib/platform/template/wx/component-config/scroll-view.js +0 -4
  27. package/lib/platform/template/wx/component-config/switch.js +0 -4
  28. package/lib/platform/template/wx/component-config/text.js +0 -4
  29. package/lib/platform/template/wx/component-config/textarea.js +0 -5
  30. package/lib/platform/template/wx/component-config/view.js +0 -4
  31. package/lib/platform/template/wx/index.js +3 -149
  32. package/lib/plugin-loader.js +287 -0
  33. package/lib/resolver/AddEnvPlugin.js +3 -4
  34. package/lib/resolver/AddModePlugin.js +3 -4
  35. package/lib/resolver/PackageEntryPlugin.js +36 -23
  36. package/lib/runtime/base.styl +0 -5
  37. package/lib/runtime/components/web/getInnerListeners.js +3 -1
  38. package/lib/runtime/components/web/mpx-image.vue +5 -20
  39. package/lib/runtime/components/web/mpx-movable-view.vue +2 -6
  40. package/lib/runtime/components/web/mpx-swiper.vue +3 -18
  41. package/lib/runtime/i18n.wxs +11 -31
  42. package/lib/runtime/optionProcessor.js +3 -48
  43. package/lib/selector.js +10 -29
  44. package/lib/staticConfig.js +4 -0
  45. package/lib/style-compiler/index.js +24 -16
  46. package/lib/style-compiler/load-postcss-config.js +1 -3
  47. package/lib/style-compiler/plugins/conditional-strip.js +65 -68
  48. package/lib/style-compiler/plugins/rpx.js +37 -43
  49. package/lib/style-compiler/plugins/scope-id.js +72 -79
  50. package/lib/style-compiler/plugins/trans-special.js +18 -25
  51. package/lib/style-compiler/plugins/trim.js +7 -13
  52. package/lib/style-compiler/plugins/vw.js +16 -22
  53. package/lib/template-compiler/compiler.js +199 -106
  54. package/lib/template-compiler/index.js +139 -52
  55. package/lib/template-compiler/trans-dynamic-class-expr.js +13 -18
  56. package/lib/url-loader.js +29 -11
  57. package/lib/utils/add-query.js +1 -1
  58. package/lib/utils/get-main-compilation.js +6 -0
  59. package/lib/utils/is-url-request.js +1 -10
  60. package/lib/utils/match-condition.js +1 -4
  61. package/lib/utils/normalize.js +15 -4
  62. package/lib/utils/parse-request.js +3 -3
  63. package/lib/utils/read-json-for-src.js +34 -0
  64. package/lib/utils/stringify-query.js +0 -4
  65. package/lib/utils/try-require.js +16 -0
  66. package/lib/web/processJSON.js +144 -113
  67. package/lib/web/processScript.js +34 -47
  68. package/lib/web/processTemplate.js +40 -57
  69. package/lib/wxml/{loader.js → wxml-loader.js} +62 -21
  70. package/lib/wxs/WxsParserPlugin.js +2 -2
  71. package/lib/wxs/WxsPlugin.js +8 -4
  72. package/lib/wxs/WxsTemplatePlugin.js +92 -46
  73. package/lib/wxs/{i18n-loader.js → wxs-i18n-loader.js} +4 -5
  74. package/lib/wxs/wxs-loader.js +117 -0
  75. package/lib/wxs/{pre-loader.js → wxs-pre-loader.js} +5 -20
  76. package/lib/wxss/getImportPrefix.js +30 -0
  77. package/lib/wxss/loader.js +43 -31
  78. package/lib/wxss/localsLoader.js +5 -1
  79. package/lib/wxss/processCss.js +103 -107
  80. package/package.json +18 -21
  81. package/LICENSE +0 -433
  82. package/lib/dependencies/AddEntryDependency.js +0 -24
  83. package/lib/dependencies/AppEntryDependency.js +0 -58
  84. package/lib/dependencies/CommonJsAsyncDependency.js +0 -51
  85. package/lib/dependencies/CommonJsVariableDependency.js +0 -81
  86. package/lib/dependencies/DynamicEntryDependency.js +0 -171
  87. package/lib/dependencies/FlagPluginDependency.js +0 -24
  88. package/lib/dependencies/InjectDependency.js +0 -43
  89. package/lib/dependencies/RecordGlobalComponentsDependency.js +0 -50
  90. package/lib/dependencies/RecordIndependentDependency.js +0 -44
  91. package/lib/dependencies/RecordResourceMapDependency.js +0 -62
  92. package/lib/dependencies/RemoveEntryDependency.js +0 -40
  93. package/lib/dependencies/ResolveDependency.js +0 -88
  94. package/lib/independent-loader.js +0 -52
  95. package/lib/json-compiler/helper.js +0 -156
  96. package/lib/json-compiler/plugin.js +0 -150
  97. package/lib/partial-compile/index.js +0 -35
  98. package/lib/record-loader.js +0 -11
  99. package/lib/resolve-loader.js +0 -6
  100. package/lib/resolver/FixDescriptionInfoPlugin.js +0 -28
  101. package/lib/runtime/components/tenon/getInnerListeners.js +0 -317
  102. package/lib/runtime/components/tenon/tenon-button.vue +0 -305
  103. package/lib/runtime/components/tenon/tenon-image.vue +0 -61
  104. package/lib/runtime/components/tenon/tenon-input.vue +0 -99
  105. package/lib/runtime/components/tenon/tenon-rich-text.vue +0 -21
  106. package/lib/runtime/components/tenon/tenon-scroll-view.vue +0 -124
  107. package/lib/runtime/components/tenon/tenon-switch.vue +0 -91
  108. package/lib/runtime/components/tenon/tenon-text-area.vue +0 -64
  109. package/lib/runtime/components/tenon/tenon-text.vue +0 -64
  110. package/lib/runtime/components/tenon/tenon-view.vue +0 -93
  111. package/lib/runtime/components/tenon/util.js +0 -44
  112. package/lib/runtime/optionProcessor.tenon.js +0 -386
  113. package/lib/style-compiler/plugins/hm.js +0 -20
  114. package/lib/tenon/index.js +0 -105
  115. package/lib/tenon/processJSON.js +0 -360
  116. package/lib/tenon/processScript.js +0 -260
  117. package/lib/tenon/processStyles.js +0 -21
  118. package/lib/tenon/processTemplate.js +0 -133
  119. package/lib/utils/const.js +0 -10
  120. package/lib/utils/emit-file.js +0 -10
  121. package/lib/utils/eval-json-js.js +0 -31
  122. package/lib/utils/get-entry-name.js +0 -13
  123. package/lib/utils/get-json-content.js +0 -42
  124. package/lib/utils/get-relative-path.js +0 -24
  125. package/lib/utils/resolve.js +0 -13
  126. package/lib/utils/set.js +0 -47
  127. package/lib/utils/stringify-loaders-resource.js +0 -25
  128. package/lib/wxs/WxsModuleIdsPlugin.js +0 -29
  129. package/lib/wxs/loader.js +0 -142
@@ -1,386 +0,0 @@
1
- // import { inBrowser } from '../utils/env'
2
-
3
- export default function processOption (
4
- option,
5
- ctorType,
6
- firstPage,
7
- componentId,
8
- pageConfig,
9
- pagesMap,
10
- componentsMap,
11
- tabBarMap,
12
- componentGenerics,
13
- genericsInfo,
14
- mixin,
15
- Vue,
16
- VueRouter,
17
- i18n
18
- ) {
19
- if (ctorType === 'app') {
20
- // 对于app中的组件需要全局注册
21
- for (const componentName in componentsMap) {
22
- if (componentsMap.hasOwnProperty(componentName)) {
23
- const component = componentsMap[componentName]
24
- Vue.component(componentName, component)
25
- }
26
- }
27
-
28
- // 注册v-ex-classes自定义指令处理externalClasses
29
- // Vue.directive('ex-classes', (el, binding, vnode) => {
30
- // const context = vnode.context
31
- // if (context) {
32
- // const externalClasses = context.$options.externalClasses || []
33
- // const classList = el.classList
34
- // binding.value.forEach((className) => {
35
- // const actualExternalClassNames = context.$attrs[className]
36
- // if (externalClasses.indexOf(className) !== -1 && actualExternalClassNames) {
37
- // classList.remove(className)
38
- // actualExternalClassNames.split(/\s+/).forEach((actualExternalClassName) => {
39
- // if (actualExternalClassName) classList.add(actualExternalClassName)
40
- // })
41
- // }
42
- // })
43
- // }
44
- // })
45
- // Vue.directive('animation', (el, binding) => {
46
- // const newActions = binding?.value?.actions
47
- // if (el.actions === newActions) {
48
- // Promise.resolve().then(() => {
49
- // Object.assign(el.style, el.lastDynamicStyle)
50
- // })
51
- // return
52
- // }
53
- // el.actions = newActions
54
- // if (typeof el.setAnimation === 'function') {
55
- // el.removeEventListener('transitionend', el.setAnimation, false)
56
- // el.setAnimation = undefined
57
- // }
58
- // el.dynamicStyleQueue = []
59
- // el.lastDynamicStyle = undefined
60
- // if (Array.isArray(newActions) && newActions.length) {
61
- // newActions.forEach((item) => {
62
- // const property = []
63
- // const { animates, option } = item
64
- // // 存储动画需要改变的样式属性
65
- // const dynamicStyle = {
66
- // transform: ''
67
- // }
68
- // animates.forEach((itemAnimation) => {
69
- // switch (itemAnimation.type) {
70
- // case 'style':
71
- // const [key, value] = itemAnimation.args
72
- // dynamicStyle[key] = value
73
- // property.push(key)
74
- // break
75
- // default:
76
- // dynamicStyle.transform += `${itemAnimation.type}(${itemAnimation.args}) `
77
- // if (!property.includes('transform')) {
78
- // property.push('transform')
79
- // }
80
- // }
81
- // })
82
- // Object.assign(dynamicStyle, {
83
- // transition: `${parseInt(option.duration)}ms ${option.timingFunction} ${parseInt(option.delay)}ms`,
84
- // transitionProperty: `${property}`,
85
- // transformOrigin: option.transformOrigin
86
- // })
87
- // el.dynamicStyleQueue.push(dynamicStyle)
88
- // })
89
- // el.setAnimation = function () {
90
- // if (!el.dynamicStyleQueue.length) {
91
- // el.removeEventListener('transitionend', el.setAnimation, false)
92
- // return
93
- // }
94
- // const dynamicStyle = el.dynamicStyleQueue.shift()
95
- // Object.assign(el.style, dynamicStyle)
96
- // el.lastDynamicStyle = dynamicStyle
97
- // }
98
- // // 首次动画属性设置
99
- // setTimeout(el.setAnimation, 0)
100
- // // 在transitionend事件内设置动画样式
101
- // el.addEventListener('transitionend', el.setAnimation, false)
102
- // }
103
- // })
104
-
105
- // const routes = []
106
-
107
- // for (const pagePath in pagesMap) {
108
- // if (pagesMap.hasOwnProperty(pagePath)) {
109
- // const page = pagesMap[pagePath]
110
- // routes.push({
111
- // path: '/' + pagePath,
112
- // component: page
113
- // })
114
- // }
115
- // }
116
-
117
- // if (routes.length) {
118
- // if (firstPage) {
119
- // routes.push({
120
- // path: '/',
121
- // redirect: '/' + firstPage
122
- // })
123
- // }
124
- // global.__mpxRouter = option.router = new VueRouter({
125
- // routes: routes
126
- // })
127
- // global.__mpxRouter.stack = []
128
- // global.__mpxRouter.needCache = null
129
- // global.__mpxRouter.needRemove = []
130
- // // 处理reLaunch中传递的url并非首页时的replace逻辑
131
- // global.__mpxRouter.beforeEach(function (to, from, next) {
132
- // let action = global.__mpxRouter.__mpxAction
133
- // const stack = global.__mpxRouter.stack
134
-
135
- // // 处理人为操作
136
- // if (!action) {
137
- // if (stack.length > 1 && stack[stack.length - 2].path === to.path) {
138
- // action = {
139
- // type: 'back',
140
- // delta: 1
141
- // }
142
- // } else {
143
- // action = {
144
- // type: 'to'
145
- // }
146
- // }
147
- // }
148
-
149
- // const pageInRoutes = routes.some(item => item.path === to.path)
150
- // if (!pageInRoutes) {
151
- // if (stack.length < 1) {
152
- // if (global.__mpxRouter.app.$options.onPageNotFound) {
153
- // // onPageNotFound,仅首次进入时生效
154
- // global.__mpxRouter.app.$options.onPageNotFound({
155
- // path: to.path,
156
- // query: to.query,
157
- // isEntryPage: true
158
- // })
159
- // return
160
- // } else {
161
- // console.warn(`[Mpx runtime warn]: the ${to.path} path does not exist in the application,will redirect to the home page path ${firstPage}`)
162
- // return next({
163
- // path: firstPage,
164
- // replace: true
165
- // })
166
- // }
167
- // } else {
168
- // let methods = ''
169
- // switch (action.type) {
170
- // case 'to':
171
- // methods = 'navigateTo'
172
- // break
173
- // case 'redirect':
174
- // methods = 'redirectTo'
175
- // break
176
- // case 'back':
177
- // methods = 'navigateBack'
178
- // break
179
- // case 'reLaunch':
180
- // methods = 'reLaunch'
181
- // break
182
- // default:
183
- // methods = 'navigateTo'
184
- // }
185
- // throw new Error(`${methods}:fail page "${to.path}" is not found`)
186
- // }
187
- // }
188
-
189
- // const insertItem = {
190
- // path: to.path
191
- // }
192
- // // 构建历史栈
193
- // switch (action.type) {
194
- // case 'to':
195
- // stack.push(insertItem)
196
- // global.__mpxRouter.needCache = insertItem
197
- // break
198
- // case 'back':
199
- // global.__mpxRouter.needRemove = stack.splice(stack.length - action.delta, action.delta)
200
- // break
201
- // case 'redirect':
202
- // global.__mpxRouter.needRemove = stack.splice(stack.length - 1, 1, insertItem)
203
- // global.__mpxRouter.needCache = insertItem
204
- // break
205
- // case 'switch':
206
- // if (!action.replaced) {
207
- // action.replaced = true
208
- // return next({
209
- // path: action.path,
210
- // replace: true
211
- // })
212
- // } else {
213
- // // 将非tabBar页面remove
214
- // let tabItem = null
215
- // global.__mpxRouter.needRemove = stack.filter((item) => {
216
- // if (tabBarMap[item.path.slice(1)]) {
217
- // tabItem = item
218
- // return false
219
- // }
220
- // return true
221
- // })
222
- // if (tabItem) {
223
- // global.__mpxRouter.stack = [tabItem]
224
- // } else {
225
- // global.__mpxRouter.stack = [insertItem]
226
- // global.__mpxRouter.needCache = insertItem
227
- // }
228
- // }
229
- // break
230
- // case 'reLaunch':
231
- // if (!action.replaced) {
232
- // action.replaced = true
233
- // return next({
234
- // path: action.path,
235
- // query: {
236
- // reLaunchCount: action.reLaunchCount
237
- // },
238
- // replace: true
239
- // })
240
- // } else {
241
- // global.__mpxRouter.needRemove = stack
242
- // global.__mpxRouter.stack = [insertItem]
243
- // global.__mpxRouter.needCache = insertItem
244
- // }
245
- // }
246
- // next()
247
- // })
248
- // // 处理visibilitychange时触发当前活跃页面组件的onshow/onhide
249
- // if (inBrowser) {
250
- // // const errorHandler = function (e) {
251
- // // if (global.__mpxAppCbs && global.__mpxAppCbs.error) {
252
- // // global.__mpxAppCbs.error.forEach((cb) => {
253
- // // cb(e)
254
- // // })
255
- // // }
256
- // // }
257
- // // Vue.config.errorHandler = errorHandler
258
- // // window.addEventListener('error', errorHandler)
259
- // // window.addEventListener('unhandledrejection', event => {
260
- // // errorHandler(event.reason)
261
- // // })
262
- // // document.addEventListener('visibilitychange', function () {
263
- // // const vnode = global.__mpxRouter && global.__mpxRouter.__mpxActiveVnode
264
- // // if (vnode && vnode.componentInstance) {
265
- // // const currentPage = vnode.tag.endsWith('mpx-tab-bar-container') ? vnode.componentInstance.$refs.tabBarPage : vnode.componentInstance
266
- // // if (document.hidden) {
267
- // // if (global.__mpxAppCbs && global.__mpxAppCbs.hide) {
268
- // // global.__mpxAppCbs.hide.forEach((cb) => {
269
- // // cb()
270
- // // })
271
- // // }
272
- // // if (currentPage) {
273
- // // currentPage.mpxPageStatus = 'hide'
274
- // // currentPage.onHide && currentPage.onHide()
275
- // // }
276
- // // } else {
277
- // // if (global.__mpxAppCbs && global.__mpxAppCbs.show) {
278
- // // global.__mpxAppCbs.show.forEach((cb) => {
279
- // // // todo 实现app.onShow参数
280
- // // /* eslint-disable standard/no-callback-literal */
281
- // // cb({})
282
- // // })
283
- // // }
284
- // // if (currentPage) {
285
- // // currentPage.mpxPageStatus = 'show'
286
- // // currentPage.onShow && currentPage.onShow()
287
- // // }
288
- // // }
289
- // // }
290
- // // })
291
- // // 初始化length
292
- // // global.__mpxRouter.__mpxHistoryLength = global.history.length
293
- // }
294
- // }
295
-
296
- // if (i18n) {
297
- // option.i18n = i18n
298
- // }
299
- } else {
300
- // 局部注册页面和组件中依赖的组件
301
- for (const componentName in componentsMap) {
302
- if (componentsMap.hasOwnProperty(componentName)) {
303
- const component = componentsMap[componentName]
304
- if (!option.components) {
305
- option.components = {}
306
- }
307
- option.components[componentName] = component
308
- }
309
- }
310
-
311
- // if (genericsInfo) {
312
- // const genericHash = genericsInfo.hash
313
- // global.__mpxGenericsMap[genericHash] = {}
314
- // Object.keys(genericsInfo.map).forEach((genericValue) => {
315
- // if (componentsMap[genericValue]) {
316
- // global.__mpxGenericsMap[genericHash][genericValue] = componentsMap[genericValue]
317
- // } else {
318
- // console.log(option)
319
- // console.warn(`[Mpx runtime warn]: generic value "${genericValue}" must be
320
- // registered in parent context!`)
321
- // }
322
- // })
323
- // }
324
-
325
- // if (componentGenerics) {
326
- // option.props = option.props || {}
327
- // option.props.generichash = String
328
- // Object.keys(componentGenerics).forEach((genericName) => {
329
- // if (componentGenerics[genericName].default) {
330
- // option.props[`generic${genericName}`] = {
331
- // type: String,
332
- // default: `${genericName}default`
333
- // }
334
- // } else {
335
- // option.props[`generic${genericName}`] = String
336
- // }
337
- // })
338
- // }
339
-
340
- if (ctorType === 'page') {
341
- (option.mixins ? option.mixins : (option.mixins = [])).push({
342
- // cache page instance in tenon
343
- created () {
344
- global.__currentPageInstance = this
345
- }
346
- })
347
- option.__mpxPageConfig = Object.assign({}, global.__mpxPageConfig, pageConfig)
348
- }
349
- }
350
-
351
- if (mixin) {
352
- if (option.mixins) {
353
- option.mixins.push(mixin)
354
- } else {
355
- option.mixins = [mixin]
356
- }
357
- }
358
-
359
- if (componentId) {
360
- option.componentPath = '/' + componentId
361
- }
362
-
363
- return option
364
- }
365
-
366
- export function getComponent (component, extendOptions) {
367
- component = component.__esModule ? component.default : component
368
- // eslint-disable-next-line
369
- if (extendOptions) Object.assign(component, extendOptions)
370
- return component
371
- }
372
-
373
- export function getWxsMixin (wxsModules) {
374
- if (!wxsModules) return {}
375
- return {
376
- created () {
377
- Object.keys(wxsModules).forEach((key) => {
378
- if (key in this) {
379
- console.error(`[Mpx runtime error]: The wxs module key [${key}] exist in the component/page instance already, please check and rename it!`)
380
- } else {
381
- this[key] = wxsModules[key]
382
- }
383
- })
384
- }
385
- }
386
- }
@@ -1,20 +0,0 @@
1
- const postcss = require('postcss')
2
- const rpxRegExp = /\b(\d+(\.\d+)?)rpx\b/
3
- const rpxRegExpG = /\b(\d+(\.\d+)?)rpx\b/g
4
-
5
- module.exports = postcss.plugin('hm', (options = {}) => root => {
6
- function transHm (declaration) {
7
- if (rpxRegExp.test(declaration.value)) {
8
- declaration.value = declaration.value.replace(rpxRegExpG, function (match, $1) {
9
- if ($1 === '0') return $1
10
- return `${$1}hm`
11
- })
12
- }
13
- }
14
-
15
- root.walkRules(rule => {
16
- rule.walkDecls(declaration => {
17
- transHm(declaration)
18
- })
19
- })
20
- })
@@ -1,105 +0,0 @@
1
- const processJSON = require('./processJSON')
2
- const processScript = require('./processScript')
3
- const processStyles = require('./processStyles')
4
- const processTemplate = require('./processTemplate')
5
-
6
- const async = require('async')
7
-
8
- module.exports = function ({
9
- mpx,
10
- loaderContext,
11
- isProduction,
12
- parts,
13
- ctorType,
14
- filePath,
15
- queryObj,
16
- autoScope,
17
- componentsMap,
18
- vueContentCache,
19
- moduleId,
20
- callback
21
- }) {
22
- const hasComment = parts.template && parts.template.attrs && parts.template.attrs.comments
23
- const isNative = false
24
- const mode = mpx.mode
25
- const srcMode = mpx.srcMode
26
- const env = mpx.env
27
- const defs = mpx.defs
28
- const resolveMode = mpx.resolveMode
29
- const pagesMap = mpx.pagesMap
30
- const projectRoot = mpx.projectRoot
31
-
32
- let output = ''
33
- let usingComponents = [].concat(Object.keys(mpx.usingComponents))
34
-
35
- return async.waterfall([
36
- (callback) => {
37
- async.parallel([
38
- (callback) => {
39
- processTemplate(parts.template, {
40
- hasComment,
41
- isNative,
42
- mode,
43
- srcMode,
44
- defs,
45
- loaderContext,
46
- moduleId,
47
- ctorType,
48
- usingComponents,
49
- decodeHTMLText: mpx.decodeHTMLText,
50
- externalClasses: mpx.externalClasses,
51
- checkUsingComponents: mpx.checkUsingComponents
52
- }, callback)
53
- },
54
- (callback) => {
55
- processStyles(parts.styles, {
56
- ctorType,
57
- autoScope
58
- }, callback)
59
- },
60
- (callback) => {
61
- processJSON(parts.json, {
62
- mode,
63
- env,
64
- defs,
65
- resolveMode,
66
- loaderContext,
67
- pagesMap,
68
- pathHash: mpx.pathHash,
69
- componentsMap,
70
- projectRoot
71
- }, callback)
72
- }
73
- ], (err, res) => {
74
- callback(err, res)
75
- })
76
- },
77
- ([templateRes, stylesRes, jsonRes], callback) => {
78
- output += templateRes.output
79
- output += stylesRes.output
80
- output += jsonRes.output
81
- if (ctorType === 'app' && jsonRes.jsonObj.window && jsonRes.jsonObj.window.navigationBarTitleText) {
82
- mpx.appTitle = jsonRes.jsonObj.window.navigationBarTitleText
83
- }
84
-
85
- processScript(parts.script, {
86
- ctorType,
87
- srcMode,
88
- loaderContext,
89
- isProduction,
90
- projectRoot,
91
- jsonConfig: jsonRes.jsonObj,
92
- componentId: queryObj.componentId || '',
93
- builtInComponentsMap: templateRes.builtInComponentsMap,
94
- localComponentsMap: jsonRes.localComponentsMap,
95
- localPagesMap: jsonRes.localPagesMap,
96
- forceDisableBuiltInLoader: mpx.forceDisableBuiltInLoader
97
- }, callback)
98
- }
99
- ], (err, scriptRes) => {
100
- if (err) return callback(err)
101
- output += scriptRes.output
102
- vueContentCache.set(filePath, output)
103
- callback(null, output)
104
- })
105
- }