@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
|
-
|
|
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
|
-
|
|
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,
|
|
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('
|
|
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'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/webpack-plugin",
|
|
3
|
-
"version": "2.9.
|
|
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": "
|
|
86
|
+
"gitHead": "80dd826352ab7178952f6ac1f2d7dbcf610fe6cf"
|
|
87
87
|
}
|