@mpxjs/webpack-plugin 2.7.12 → 2.7.13
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
|
@@ -11,6 +11,7 @@ const CommonJsAsyncDependency = require('./dependencies/CommonJsAsyncDependency'
|
|
|
11
11
|
const NormalModule = require('webpack/lib/NormalModule')
|
|
12
12
|
const EntryPlugin = require('webpack/lib/EntryPlugin')
|
|
13
13
|
const JavascriptModulesPlugin = require('webpack/lib/javascript/JavascriptModulesPlugin')
|
|
14
|
+
const FileSystemInfo = require('webpack/lib/FileSystemInfo')
|
|
14
15
|
const normalize = require('./utils/normalize')
|
|
15
16
|
const toPosix = require('./utils/to-posix')
|
|
16
17
|
const addQuery = require('./utils/add-query')
|
|
@@ -159,6 +160,14 @@ class MpxWebpackPlugin {
|
|
|
159
160
|
}, options.nativeConfig)
|
|
160
161
|
options.webConfig = options.webConfig || {}
|
|
161
162
|
this.options = options
|
|
163
|
+
// Hack for buildDependencies
|
|
164
|
+
const rawResolveBuildDependencies = FileSystemInfo.prototype.resolveBuildDependencies
|
|
165
|
+
FileSystemInfo.prototype.resolveBuildDependencies = function (context, deps, rawCallback) {
|
|
166
|
+
return rawResolveBuildDependencies.call(this, context, deps, (err, result) => {
|
|
167
|
+
if (result && typeof options.hackResolveBuildDependencies === 'function') options.hackResolveBuildDependencies(result)
|
|
168
|
+
return rawCallback(err, result)
|
|
169
|
+
})
|
|
170
|
+
}
|
|
162
171
|
}
|
|
163
172
|
|
|
164
173
|
static loader (options = {}) {
|
|
@@ -1303,8 +1312,8 @@ try {
|
|
|
1303
1312
|
const currentLoader = toPosix(loader.loader)
|
|
1304
1313
|
if (currentLoader.includes(info[0])) {
|
|
1305
1314
|
loader.loader = info[1]
|
|
1306
|
-
|
|
1307
|
-
if (currentLoader.includes(info[1])) {
|
|
1315
|
+
insertBeforeIndex = index
|
|
1316
|
+
} else if (currentLoader.includes(info[1])) {
|
|
1308
1317
|
insertBeforeIndex = index
|
|
1309
1318
|
}
|
|
1310
1319
|
})
|
|
@@ -16,7 +16,9 @@ module.exports = function loadPostcssConfig (loaderContext, inlineConfig = {}) {
|
|
|
16
16
|
webpack: loaderContext,
|
|
17
17
|
defs: inlineConfig.defs || {}
|
|
18
18
|
}
|
|
19
|
-
loaded = load(ctx, config.path, {
|
|
19
|
+
loaded = load(ctx, config.path, {
|
|
20
|
+
loaders: { '.json': (_, content) => JSON.parse(content) }
|
|
21
|
+
}).catch(err => {
|
|
20
22
|
// postcss-load-config throws error when no config file is found,
|
|
21
23
|
// but for us it's optional. only emit other errors
|
|
22
24
|
if (err.message.indexOf('No PostCSS Config found') >= 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/webpack-plugin",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.13",
|
|
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": "
|
|
83
|
+
"gitHead": "be0a3699bcc617e76ffa6a27c0925da157335033"
|
|
84
84
|
}
|