@mpxjs/webpack-plugin 2.6.107 → 2.6.108

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 CHANGED
@@ -38,7 +38,6 @@ module.exports = function (content) {
38
38
  const localSrcMode = queryObj.mode
39
39
  const srcMode = localSrcMode || globalSrcMode
40
40
  const vueContentCache = mpx.vueContentCache
41
- const webRouteMode = mpx.webConfig.routeMode || 'hash'
42
41
  const autoScope = matchCondition(resourcePath, mpx.autoScopeRules)
43
42
 
44
43
  // 支持资源query传入page或component支持页面/组件单独编译
@@ -245,7 +244,6 @@ module.exports = function (content) {
245
244
  i18n,
246
245
  componentGenerics,
247
246
  projectRoot,
248
- webRouteMode,
249
247
  jsonConfig: jsonRes.jsonObj,
250
248
  componentId: queryObj.componentId || '',
251
249
  tabBarMap: jsonRes.tabBarMap,
@@ -73,7 +73,12 @@ module.exports = function getSpec ({ warn, error }) {
73
73
  swan: deletePath()
74
74
  },
75
75
  {
76
- test: 'onReachBottomDistance|disableScroll',
76
+ test: 'onReachBottomDistance',
77
+ qq: deletePath(),
78
+ jd: deletePath()
79
+ },
80
+ {
81
+ test: 'disableScroll',
77
82
  ali: deletePath(),
78
83
  qq: deletePath(),
79
84
  jd: deletePath()
@@ -84,7 +89,7 @@ module.exports = function getSpec ({ warn, error }) {
84
89
  swan: deletePath()
85
90
  },
86
91
  {
87
- test: 'navigationBarTextStyle|navigationStyle|backgroundColor|backgroundTextStyle',
92
+ test: 'navigationBarTextStyle|navigationStyle|backgroundTextStyle',
88
93
  ali: deletePath()
89
94
  },
90
95
  {
@@ -44,7 +44,7 @@ module.exports = function ({ print }) {
44
44
  // 如果是个变量,报warning~
45
45
  aliPropLog(attr)
46
46
  } else {
47
- let supportedList = ['navigate', 'redirect', 'switchTab', 'navigateBack', 'reLaunch']
47
+ let supportedList = ['navigate', 'redirect', 'switchTab', 'navigateBack', 'reLaunch', 'exit']
48
48
  if (supportedList.indexOf(attr.value) === -1) {
49
49
  aliValueLogError(attr)
50
50
  }
@@ -12,7 +12,6 @@ export default function processOption (
12
12
  componentGenerics,
13
13
  genericsInfo,
14
14
  mixin,
15
- webRouteMode,
16
15
  Vue,
17
16
  VueRouter,
18
17
  i18n
@@ -122,8 +121,9 @@ export default function processOption (
122
121
  redirect: '/' + firstPage
123
122
  })
124
123
  }
124
+ const webRouteConfig = global.__mpx.config.webRouteConfig
125
125
  global.__mpxRouter = option.router = new VueRouter({
126
- mode: webRouteMode,
126
+ ...webRouteConfig,
127
127
  routes: routes
128
128
  })
129
129
  global.__mpxRouter.stack = []
@@ -93,7 +93,7 @@ function isDef (v) {
93
93
  return v !== undefined && v !== null
94
94
  }
95
95
 
96
- function stringifyClass (value) {
96
+ function stringifyDynamicClass (value) {
97
97
  if (!value) return ''
98
98
  if (likeArray(value)) {
99
99
  return stringifyArray(value)
@@ -111,7 +111,7 @@ function stringifyArray (value) {
111
111
  var res = ''
112
112
  var stringified
113
113
  for (var i = 0; i < value.length; i++) {
114
- if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
114
+ if (isDef(stringified = stringifyDynamicClass(value[i])) && stringified !== '') {
115
115
  if (res) res += ' '
116
116
  res += stringified
117
117
  }
@@ -207,7 +207,7 @@ module.exports = {
207
207
  if (typeof staticClass !== 'string') {
208
208
  return console.log('Template attr class must be a string!')
209
209
  }
210
- return concat(staticClass, stringifyClass(dynamicClass))
210
+ return concat(staticClass, stringifyDynamicClass(dynamicClass))
211
211
  },
212
212
  stringifyStyle: function (staticStyle, dynamicStyle) {
213
213
  var normalizedDynamicStyle = normalizeDynamicStyle(dynamicStyle)
@@ -2,7 +2,7 @@ const getMainCompilation = require('../utils/get-main-compilation')
2
2
  const postcss = require('postcss')
3
3
  const loaderUtils = require('loader-utils')
4
4
  const loadPostcssConfig = require('./load-postcss-config')
5
- const { MPX_ROOT_VIEW } = require('../staticConfig')
5
+ const { MPX_ROOT_VIEW, MPX_APP_MODULE_ID } = require('../staticConfig')
6
6
  const trim = require('./plugins/trim')
7
7
  const rpx = require('./plugins/rpx')
8
8
  const vw = require('./plugins/vw')
@@ -91,7 +91,7 @@ module.exports = function (css, map) {
91
91
  .then(result => {
92
92
  // ali环境添加全局样式抹平root差异
93
93
  if (mpx.mode === 'ali' && isApp) {
94
- result.css += `\n.${MPX_ROOT_VIEW} { display: inline; line-height: normal; }\n`
94
+ result.css += `\n.${MPX_ROOT_VIEW} { display: initial }\n.${MPX_APP_MODULE_ID} { line-height: normal }`
95
95
  }
96
96
  if (result.messages) {
97
97
  result.messages.forEach(({ type, file }) => {
@@ -39,7 +39,6 @@ module.exports = function (script, options, callback) {
39
39
  const genericsInfo = options.genericsInfo
40
40
  const componentGenerics = options.componentGenerics
41
41
  const forceDisableBuiltInLoader = options.forceDisableBuiltInLoader
42
- const webRouteMode = options.webRouteMode
43
42
 
44
43
  const emitWarning = (msg) => {
45
44
  loaderContext.emitWarning(
@@ -255,8 +254,7 @@ module.exports = function (script, options, callback) {
255
254
  ${JSON.stringify(tabBarMap)},
256
255
  ${JSON.stringify(componentGenerics)},
257
256
  ${JSON.stringify(genericsInfo)},
258
- getWxsMixin(wxsModules),
259
- ${JSON.stringify(webRouteMode)}`
257
+ getWxsMixin(wxsModules)`
260
258
 
261
259
  if (ctorType === 'app') {
262
260
  content += `,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.6.107",
3
+ "version": "2.6.108",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -81,5 +81,5 @@
81
81
  "@types/babel-traverse": "^6.25.4",
82
82
  "@types/babel-types": "^7.0.4"
83
83
  },
84
- "gitHead": "c5821595c58c2908d56de41e68f1462b949bf646"
84
+ "gitHead": "5efa2dec1597b0b7dd45e46b3ddf23bf46e25177"
85
85
  }