@mpxjs/webpack-plugin 2.7.4 → 2.7.5

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/extractor.js CHANGED
@@ -16,7 +16,7 @@ module.exports.pitch = async function (remainingRequest) {
16
16
  const type = queryObj.type
17
17
  const index = queryObj.index || 0
18
18
  const isStatic = queryObj.isStatic
19
- const issuerFile = queryObj.issuerFile
19
+ const issuerResource = queryObj.issuerResource
20
20
  const fromImport = queryObj.fromImport
21
21
  const needBabel = queryObj.needBabel
22
22
 
@@ -82,7 +82,8 @@ module.exports.pitch = async function (remainingRequest) {
82
82
  // styles为static就两种情况,一种是.mpx中使用src引用样式,第二种为css-loader中处理@import
83
83
  // 为了支持持久化缓存,.mpx中使用src引用样式对issueFile asset产生的副作用迁移到ExtractDependency中处理
84
84
  case 'styles':
85
- if (issuerFile) {
85
+ if (issuerResource) {
86
+ const issuerFile = mpx.getExtractedFile(issuerResource)
86
87
  let relativePath = toPosix(path.relative(path.dirname(issuerFile), file))
87
88
  relativePath = fixRelative(relativePath, mode)
88
89
  if (fromImport) {
package/lib/loader.js CHANGED
@@ -290,7 +290,7 @@ module.exports = function (content) {
290
290
  ...style.src ? {
291
291
  ...queryObj,
292
292
  isStatic: true,
293
- issuerFile: mpx.getExtractedFile(addQuery(this.resource, { type: 'styles' }, true))
293
+ issuerResource: addQuery(this.resource, { type: 'styles' }, true)
294
294
  } : null,
295
295
  moduleId,
296
296
  scoped
@@ -85,6 +85,10 @@
85
85
  animation: {
86
86
  type: Boolean,
87
87
  default: true
88
+ },
89
+ speed: {
90
+ type: Number,
91
+ default: 1000
88
92
  }
89
93
  },
90
94
  watch: {
@@ -96,7 +100,7 @@
96
100
  if (newVal < this.bs.maxScrollX) {
97
101
  newVal = this.bs.maxScrollX
98
102
  }
99
- this.bs.scrollTo(newVal, this.bs.y)
103
+ this.bs.scrollTo(newVal, this.bs.y, this.speed)
100
104
  },
101
105
  y (newVal) {
102
106
  this.source = ''
@@ -106,7 +110,7 @@
106
110
  if (newVal < this.bs.maxScrollY) {
107
111
  newVal = this.bs.maxScrollY
108
112
  }
109
- this.bs.scrollTo(this.bs.x, newVal)
113
+ this.bs.scrollTo(this.bs.x, newVal, this.speed)
110
114
  },
111
115
  scaleValue (newVal) {
112
116
  this.isZooming = true
@@ -99,7 +99,7 @@ module.exports = function (content) {
99
99
  case config[mode].wxs.tag:
100
100
  // 显式传递issuerResource避免模块缓存以及提供给wxs-loader计算相对路径
101
101
  extraOptions = {
102
- issuerFile: mpx.getExtractedFile(this.resource),
102
+ issuerResource: this.resource,
103
103
  isStatic: true
104
104
  }
105
105
  requestString = getRequestString('wxs', { src, mode: localSrcMode }, extraOptions)
@@ -73,7 +73,7 @@ module.exports = function (content, map) {
73
73
  } else {
74
74
  const requestString = getRequestString('styles', { src: imp.url }, {
75
75
  isStatic: true,
76
- issuerFile: mpx.getExtractedFile(this.resource),
76
+ issuerResource: this.resource,
77
77
  fromImport: true
78
78
  }, i)
79
79
  return 'exports.push([module.id, ' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.7.4",
3
+ "version": "2.7.5",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -80,5 +80,5 @@
80
80
  "engines": {
81
81
  "node": ">=14.14.0"
82
82
  },
83
- "gitHead": "4b78885a767a52eb0a970d3721f0c63cf9817c29"
83
+ "gitHead": "84d834c2ace18403bb1d4beb8585a1bfaca8e509"
84
84
  }