@mpxjs/webpack-plugin 2.7.59 → 2.7.60
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/selector.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const parseComponent = require('./parser')
|
|
2
2
|
const parseRequest = require('./utils/parse-request')
|
|
3
3
|
const tsWatchRunLoaderFilter = require('./utils/ts-loader-watch-run-loader-filter')
|
|
4
|
-
const path = require(
|
|
4
|
+
const path = require('path')
|
|
5
5
|
|
|
6
6
|
module.exports = function (content) {
|
|
7
7
|
this.cacheable()
|
package/lib/url-loader.js
CHANGED
|
@@ -3,24 +3,15 @@ const mime = require('mime')
|
|
|
3
3
|
const parseRequest = require('./utils/parse-request')
|
|
4
4
|
const getOptions = loaderUtils.getOptions
|
|
5
5
|
|
|
6
|
-
function isStyleRequest (request) {
|
|
7
|
-
const { loaderString, queryObj } = parseRequest(request)
|
|
8
|
-
if (queryObj.type === 'styles') return true
|
|
9
|
-
if (/(css-loader|wxss\/loader)/.test(loaderString)) return true
|
|
10
|
-
return false
|
|
11
|
-
}
|
|
12
|
-
|
|
13
6
|
module.exports = function (src) {
|
|
14
7
|
let transBase64 = false
|
|
15
8
|
const options = Object.assign({}, getOptions(this))
|
|
16
9
|
const { resourcePath, queryObj } = parseRequest(this.resource)
|
|
17
10
|
const mimetype = options.mimetype || mime.getType(resourcePath)
|
|
18
|
-
const moduleGraph = this._compilation.moduleGraph
|
|
19
|
-
const issuer = moduleGraph.getIssuer(this._module)
|
|
20
11
|
const publicPathScope = options.publicPathScope === 'all' ? 'all' : 'styleOnly'
|
|
21
12
|
const limit = options.limit
|
|
22
13
|
const useLocal = !limit || src.length < limit || queryObj.useLocal
|
|
23
|
-
const isStyle =
|
|
14
|
+
const isStyle = queryObj.isStyle
|
|
24
15
|
|
|
25
16
|
if (isStyle) {
|
|
26
17
|
if (options.publicPath) {
|
|
@@ -8,6 +8,8 @@ const {
|
|
|
8
8
|
WEBPACK_IGNORE_COMMENT_REGEXP
|
|
9
9
|
} = require('../utils')
|
|
10
10
|
|
|
11
|
+
const addQuery = require('../../utils/add-query')
|
|
12
|
+
|
|
11
13
|
const isUrlFunc = /url/i
|
|
12
14
|
const isImageSetFunc = /^(?:-webkit-)?image-set$/i
|
|
13
15
|
const needParseDeclaration = /(?:url|(?:-webkit-)?image-set)\(/i
|
|
@@ -402,13 +404,13 @@ const plugin = (options = {}) => {
|
|
|
402
404
|
if (!importName) {
|
|
403
405
|
importName = `___CSS_LOADER_URL_IMPORT_${urlToNameMap.size}___`
|
|
404
406
|
urlToNameMap.set(newUrl, importName)
|
|
405
|
-
|
|
407
|
+
const finalUrl = addQuery(newUrl, { isStyle: true })
|
|
406
408
|
options.imports.push({
|
|
407
409
|
type: 'url',
|
|
408
410
|
importName,
|
|
409
411
|
url: options.resolver
|
|
410
|
-
? options.urlHandler(
|
|
411
|
-
: JSON.stringify(
|
|
412
|
+
? options.urlHandler(finalUrl)
|
|
413
|
+
: JSON.stringify(finalUrl),
|
|
412
414
|
index
|
|
413
415
|
})
|
|
414
416
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/webpack-plugin",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.60",
|
|
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": "72ac7dda91b406492c0f58eb64034cb5d0bd0fe2"
|
|
84
84
|
}
|