@mpxjs/webpack-plugin 2.9.16 → 2.9.17

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/index.js CHANGED
@@ -365,13 +365,18 @@ class MpxWebpackPlugin {
365
365
  if (this.options.writeMode === 'changed') {
366
366
  const writedFileContentMap = new Map()
367
367
  const originalWriteFile = compiler.outputFileSystem.writeFile
368
- compiler.outputFileSystem.writeFile = (filePath, content, callback) => {
368
+ // fs.writeFile(file, data[, options], callback)
369
+ compiler.outputFileSystem.writeFile = (filePath, content, ...args) => {
369
370
  const lastContent = writedFileContentMap.get(filePath)
370
371
  if (Buffer.isBuffer(lastContent) ? lastContent.equals(content) : lastContent === content) {
371
- return callback()
372
+ const callback = args[args.length - 1]
373
+ if (typeof callback === 'function') {
374
+ callback()
375
+ }
376
+ return
372
377
  }
373
378
  writedFileContentMap.set(filePath, content)
374
- originalWriteFile(filePath, content, callback)
379
+ originalWriteFile(filePath, content, ...args)
375
380
  }
376
381
  }
377
382
 
@@ -1288,7 +1293,7 @@ class MpxWebpackPlugin {
1288
1293
  target = expr.object
1289
1294
  }
1290
1295
 
1291
- if (!matchCondition(resourcePath, this.options.transMpxRules) || resourcePath.indexOf('@mpxjs') !== -1 || !target || mode === srcMode) return
1296
+ if (!matchCondition(resourcePath, this.options.transMpxRules) || resourcePath.indexOf('node_modules/@mpxjs') !== -1 || !target || mode === srcMode) return
1292
1297
 
1293
1298
  const type = target.name
1294
1299
  const name = type === 'wx' ? 'mpx' : 'createFactory'
@@ -142,4 +142,7 @@
142
142
  display block
143
143
  position relative
144
144
  resize none
145
+ border: none
146
+ outline: none
147
+ background: transparent
145
148
  </style>
@@ -261,6 +261,7 @@ function createApp ({ componentsMap, Vue, pagesMap, firstPage, VueRouter, App, t
261
261
  global.__mpxAppCbs.error.forEach((cb) => {
262
262
  cb.apply(null, args)
263
263
  })
264
+ console.error(...args)
264
265
  } else if (fromVue) {
265
266
  throw args[0]
266
267
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.9.16",
3
+ "version": "2.9.17",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -83,5 +83,5 @@
83
83
  "engines": {
84
84
  "node": ">=14.14.0"
85
85
  },
86
- "gitHead": "60cfd1708a61c925d5fc08cca0b31a06b2c4c160"
86
+ "gitHead": "80dd826352ab7178952f6ac1f2d7dbcf610fe6cf"
87
87
  }