@mpxjs/webpack-plugin 2.8.13 → 2.8.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/loader.js +5 -3
- package/lib/platform/json/wx/index.js +36 -0
- package/lib/runtime/components/ali/mpx-text.mpx +3 -0
- package/lib/runtime/components/ali/mpx-view.mpx +3 -0
- package/lib/selector.js +8 -1
- package/lib/style-compiler/index.js +35 -6
- package/lib/utils/get-entry-name.js +1 -1
- package/lib/utils/ts-loader-watch-run-loader-filter.js +23 -0
- package/lib/wxss/loader.js +15 -26
- package/lib/wxss/plugins/postcss-import-parser.js +5 -4
- package/lib/wxss/plugins/postcss-url-parser.js +4 -2
- package/lib/wxss/utils.js +18 -18
- package/package.json +2 -2
package/lib/loader.js
CHANGED
|
@@ -18,15 +18,17 @@ const AppEntryDependency = require('./dependencies/AppEntryDependency')
|
|
|
18
18
|
const RecordResourceMapDependency = require('./dependencies/RecordResourceMapDependency')
|
|
19
19
|
const RecordVueContentDependency = require('./dependencies/RecordVueContentDependency')
|
|
20
20
|
const CommonJsVariableDependency = require('./dependencies/CommonJsVariableDependency')
|
|
21
|
+
const tsWatchRunLoaderFilter = require('./utils/ts-loader-watch-run-loader-filter')
|
|
21
22
|
const { MPX_APP_MODULE_ID } = require('./utils/const')
|
|
22
23
|
const path = require('path')
|
|
23
24
|
|
|
24
25
|
module.exports = function (content) {
|
|
25
26
|
this.cacheable()
|
|
26
27
|
|
|
27
|
-
// 兼容处理处理ts-loader中watch-run/updateFile逻辑,直接跳过当前loader及后续的
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
// 兼容处理处理ts-loader中watch-run/updateFile逻辑,直接跳过当前loader及后续的loader返回内容
|
|
29
|
+
const pathExtname = path.extname(this.resourcePath)
|
|
30
|
+
if (!['.vue', '.mpx'].includes(pathExtname)) {
|
|
31
|
+
this.loaderIndex = tsWatchRunLoaderFilter(this.loaders, this.loaderIndex)
|
|
30
32
|
return content
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
const runRules = require('../../run-rules')
|
|
2
2
|
const normalizeTest = require('../normalize-test')
|
|
3
3
|
const changeKey = require('../change-key')
|
|
4
|
+
const normalize = require('../../../utils/normalize')
|
|
5
|
+
|
|
6
|
+
const mpxViewPath = normalize.lib('runtime/components/ali/mpx-view.mpx')
|
|
7
|
+
const mpxTextPath = normalize.lib('runtime/components/ali/mpx-text.mpx')
|
|
4
8
|
|
|
5
9
|
module.exports = function getSpec ({ warn, error }) {
|
|
6
10
|
function print (mode, path, isError) {
|
|
@@ -38,6 +42,30 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
38
42
|
return input
|
|
39
43
|
}
|
|
40
44
|
|
|
45
|
+
// 处理支付宝 componentPlaceholder 不支持 view、text 原生标签
|
|
46
|
+
function aliComponentPlaceholderFallback (input) {
|
|
47
|
+
const componentPlaceholder = input.componentPlaceholder
|
|
48
|
+
const usingComponents = input.usingComponents || (input.usingComponents = {})
|
|
49
|
+
for (const cph in componentPlaceholder) {
|
|
50
|
+
const cur = componentPlaceholder[cph]
|
|
51
|
+
const placeholderCompMatched = cur.match(/^(?:view|text)$/g)
|
|
52
|
+
if (!Array.isArray(placeholderCompMatched)) continue
|
|
53
|
+
let compName, compPath
|
|
54
|
+
switch (placeholderCompMatched[0]) {
|
|
55
|
+
case 'view':
|
|
56
|
+
compName = 'mpx-view'
|
|
57
|
+
compPath = mpxViewPath
|
|
58
|
+
break
|
|
59
|
+
case 'text':
|
|
60
|
+
compName = 'mpx-text'
|
|
61
|
+
compPath = mpxTextPath
|
|
62
|
+
}
|
|
63
|
+
usingComponents[compName] = compPath
|
|
64
|
+
componentPlaceholder[cph] = compName
|
|
65
|
+
}
|
|
66
|
+
return input
|
|
67
|
+
}
|
|
68
|
+
|
|
41
69
|
const spec = {
|
|
42
70
|
supportedModes: ['ali', 'swan', 'qq', 'tt', 'jd', 'qa', 'dd'],
|
|
43
71
|
normalizeTest,
|
|
@@ -99,6 +127,10 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
99
127
|
tt: deletePath(),
|
|
100
128
|
jd: deletePath()
|
|
101
129
|
},
|
|
130
|
+
{
|
|
131
|
+
test: 'componentPlaceholder',
|
|
132
|
+
ali: aliComponentPlaceholderFallback
|
|
133
|
+
},
|
|
102
134
|
{
|
|
103
135
|
ali: addGlobalComponents,
|
|
104
136
|
swan: addGlobalComponents,
|
|
@@ -112,6 +144,10 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
112
144
|
test: 'componentGenerics',
|
|
113
145
|
ali: deletePath(true)
|
|
114
146
|
},
|
|
147
|
+
{
|
|
148
|
+
test: 'componentPlaceholder',
|
|
149
|
+
ali: aliComponentPlaceholderFallback
|
|
150
|
+
},
|
|
115
151
|
{
|
|
116
152
|
ali: addGlobalComponents,
|
|
117
153
|
swan: addGlobalComponents,
|
package/lib/selector.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
const path = require('path')
|
|
1
2
|
const parseComponent = require('./parser')
|
|
2
3
|
const parseRequest = require('./utils/parse-request')
|
|
4
|
+
const tsWatchRunLoaderFilter = require('./utils/ts-loader-watch-run-loader-filter')
|
|
3
5
|
|
|
4
6
|
module.exports = function (content) {
|
|
5
7
|
this.cacheable()
|
|
6
|
-
|
|
8
|
+
// 兼容处理处理ts-loader中watch-run/updateFile逻辑,直接跳过当前loader及后续的loader返回内容
|
|
9
|
+
const pathExtname = path.extname(this.resourcePath)
|
|
10
|
+
if (!['.vue', '.mpx'].includes(pathExtname)) {
|
|
11
|
+
this.loaderIndex = tsWatchRunLoaderFilter(this.loaders, this.loaderIndex)
|
|
12
|
+
return content
|
|
13
|
+
}
|
|
7
14
|
// 移除mpx访问依赖,支持 thread-loader
|
|
8
15
|
const { mode, env } = this.getOptions() || {}
|
|
9
16
|
if (!mode && !env) {
|
|
@@ -86,13 +86,42 @@ module.exports = function (css, map) {
|
|
|
86
86
|
if (mode === 'ali' && isApp) {
|
|
87
87
|
result.css += `\n.${MPX_ROOT_VIEW} { display: initial }\n.${MPX_APP_MODULE_ID} { line-height: normal }`
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
this.addDependency(file)
|
|
93
|
-
}
|
|
94
|
-
})
|
|
89
|
+
|
|
90
|
+
for (const warning of result.warnings()) {
|
|
91
|
+
this.emitWarning(warning)
|
|
95
92
|
}
|
|
93
|
+
|
|
94
|
+
// todo 后续考虑直接使用postcss-loader来处理postcss
|
|
95
|
+
for (const message of result.messages) {
|
|
96
|
+
// eslint-disable-next-line default-case
|
|
97
|
+
switch (message.type) {
|
|
98
|
+
case 'dependency':
|
|
99
|
+
this.addDependency(message.file)
|
|
100
|
+
break
|
|
101
|
+
|
|
102
|
+
case 'build-dependency':
|
|
103
|
+
this.addBuildDependency(message.file)
|
|
104
|
+
break
|
|
105
|
+
|
|
106
|
+
case 'missing-dependency':
|
|
107
|
+
this.addMissingDependency(message.file)
|
|
108
|
+
break
|
|
109
|
+
|
|
110
|
+
case 'context-dependency':
|
|
111
|
+
this.addContextDependency(message.file)
|
|
112
|
+
break
|
|
113
|
+
|
|
114
|
+
case 'dir-dependency':
|
|
115
|
+
this.addContextDependency(message.dir)
|
|
116
|
+
break
|
|
117
|
+
|
|
118
|
+
case 'asset':
|
|
119
|
+
if (message.content && message.file) {
|
|
120
|
+
this.emitFile(message.file, message.content, message.sourceMap, message.info)
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
96
125
|
const map = result.map && result.map.toJSON()
|
|
97
126
|
cb(null, result.css, map)
|
|
98
127
|
return null // silence bluebird warning
|
|
@@ -4,7 +4,7 @@ module.exports = function (loaderContext) {
|
|
|
4
4
|
let entryName = ''
|
|
5
5
|
for (const [name, { dependencies }] of loaderContext._compilation.entries) {
|
|
6
6
|
const entryModule = moduleGraph.getModule(dependencies[0])
|
|
7
|
-
if (entryModule.resource === loaderContext.resource) {
|
|
7
|
+
if (entryModule && entryModule.resource === loaderContext.resource) {
|
|
8
8
|
entryName = name
|
|
9
9
|
break
|
|
10
10
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const normalize = require('./normalize')
|
|
2
|
+
const selectorPath = normalize.lib('selector.js')
|
|
3
|
+
const scriptSetupPath = normalize.lib('script-setup-compiler/index.js')
|
|
4
|
+
const mpxLoaderPath = normalize.lib('loader.js')
|
|
5
|
+
const { has } = require('./set')
|
|
6
|
+
|
|
7
|
+
const tsLoaderWatchRunFilterLoaders = new Set([
|
|
8
|
+
selectorPath,
|
|
9
|
+
scriptSetupPath,
|
|
10
|
+
mpxLoaderPath,
|
|
11
|
+
'node_modules/vue-loader/lib/index.js'
|
|
12
|
+
])
|
|
13
|
+
|
|
14
|
+
module.exports = (loaders, loaderIndex) => {
|
|
15
|
+
for (let len = loaders.length; len > 0; --len) {
|
|
16
|
+
const currentLoader = loaders[len - 1]
|
|
17
|
+
if (!has(tsLoaderWatchRunFilterLoaders, filterLoaderPath => currentLoader.path.endsWith(filterLoaderPath))) {
|
|
18
|
+
break
|
|
19
|
+
}
|
|
20
|
+
loaderIndex--
|
|
21
|
+
}
|
|
22
|
+
return loaderIndex
|
|
23
|
+
}
|
package/lib/wxss/loader.js
CHANGED
|
@@ -45,8 +45,7 @@ module.exports = async function loader (content, map, meta) {
|
|
|
45
45
|
let options
|
|
46
46
|
|
|
47
47
|
try {
|
|
48
|
-
options = normalizeOptions(rawOptions, this)
|
|
49
|
-
options = Object.assign({}, options, { sourceMap, root, externals })
|
|
48
|
+
options = normalizeOptions(Object.assign({}, rawOptions, { sourceMap }), this)
|
|
50
49
|
} catch (error) {
|
|
51
50
|
callback(error)
|
|
52
51
|
|
|
@@ -60,7 +59,7 @@ module.exports = async function loader (content, map, meta) {
|
|
|
60
59
|
plugins.push(...getModulesPlugins(options, this))
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
|
|
62
|
+
const importPluginImports = []
|
|
64
63
|
const importPluginApi = []
|
|
65
64
|
|
|
66
65
|
let isSupportAbsoluteURL = false
|
|
@@ -78,22 +77,26 @@ module.exports = async function loader (content, map, meta) {
|
|
|
78
77
|
options.esModule && Boolean('fsStartTime' in this._compiler)
|
|
79
78
|
|
|
80
79
|
if (shouldUseImportPlugin(options)) {
|
|
80
|
+
const { getRequestString } = createHelpers(this)
|
|
81
81
|
plugins.push(
|
|
82
82
|
importParser({
|
|
83
83
|
isSupportAbsoluteURL: false,
|
|
84
84
|
isSupportDataURL: false,
|
|
85
|
+
externals,
|
|
86
|
+
root,
|
|
85
87
|
isCSSStyleSheet: options.exportType === 'css-style-sheet',
|
|
86
88
|
loaderContext: this,
|
|
87
89
|
imports: importPluginImports,
|
|
88
90
|
api: importPluginApi,
|
|
89
91
|
filter: options.import.filter,
|
|
90
|
-
urlHandler: (url) =>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
urlHandler: (url) => {
|
|
93
|
+
url = combineRequests(getPreRequester(this)(options.importLoaders), url)
|
|
94
|
+
return getRequestString('styles', { src: url }, {
|
|
95
|
+
isStatic: true,
|
|
96
|
+
issuerResource: this.resource,
|
|
97
|
+
fromImport: true
|
|
98
|
+
})
|
|
99
|
+
}
|
|
97
100
|
})
|
|
98
101
|
)
|
|
99
102
|
}
|
|
@@ -107,6 +110,8 @@ module.exports = async function loader (content, map, meta) {
|
|
|
107
110
|
urlParser({
|
|
108
111
|
isSupportAbsoluteURL,
|
|
109
112
|
isSupportDataURL,
|
|
113
|
+
externals,
|
|
114
|
+
root,
|
|
110
115
|
imports: urlPluginImports,
|
|
111
116
|
replacements,
|
|
112
117
|
context: this.context,
|
|
@@ -205,22 +210,6 @@ module.exports = async function loader (content, map, meta) {
|
|
|
205
210
|
this.emitWarning(new Warning(warning))
|
|
206
211
|
}
|
|
207
212
|
|
|
208
|
-
const { getRequestString } = createHelpers(this)
|
|
209
|
-
|
|
210
|
-
// 符合css后缀名的文件经过mpx处理后会带上相应的后缀防止 WebPack 的默认解析规则,后续 require/import 相应路径时,导出的不是一段 css 代码了,事实上是一个文件路径。
|
|
211
|
-
importPluginImports = importPluginImports.map((importItem, index) => {
|
|
212
|
-
const splittedUrl = importItem.url.slice(1, -1)
|
|
213
|
-
const requestString = getRequestString('styles', { src: splittedUrl }, {
|
|
214
|
-
isStatic: true,
|
|
215
|
-
issuerResource: this.resource,
|
|
216
|
-
fromImport: true
|
|
217
|
-
}, index)
|
|
218
|
-
return {
|
|
219
|
-
...importItem,
|
|
220
|
-
url: requestString
|
|
221
|
-
}
|
|
222
|
-
})
|
|
223
|
-
|
|
224
213
|
const imports = []
|
|
225
214
|
.concat(icssPluginImports.sort(sort))
|
|
226
215
|
.concat(importPluginImports.sort())
|
|
@@ -46,7 +46,7 @@ function parseNode (atRule, key, options) {
|
|
|
46
46
|
// Nodes do not exists - `@import url('http://') :root {}`
|
|
47
47
|
if (atRule.nodes) {
|
|
48
48
|
const error = new Error(
|
|
49
|
-
|
|
49
|
+
'It looks like you didn\'t end your @import statement correctly. Child nodes are attached to it.'
|
|
50
50
|
)
|
|
51
51
|
|
|
52
52
|
error.node = atRule
|
|
@@ -215,7 +215,7 @@ const plugin = (options = {}) => {
|
|
|
215
215
|
options.loaderContext.emitError(
|
|
216
216
|
new Error(
|
|
217
217
|
atRule.error(
|
|
218
|
-
|
|
218
|
+
'\'@import\' rules are not allowed here and will not be processed'
|
|
219
219
|
).message
|
|
220
220
|
)
|
|
221
221
|
)
|
|
@@ -223,7 +223,7 @@ const plugin = (options = {}) => {
|
|
|
223
223
|
return
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
const { isSupportDataURL, isSupportAbsoluteURL } = options
|
|
226
|
+
const { isSupportDataURL, isSupportAbsoluteURL, externals, root } = options
|
|
227
227
|
|
|
228
228
|
let parsedAtRule
|
|
229
229
|
|
|
@@ -231,7 +231,8 @@ const plugin = (options = {}) => {
|
|
|
231
231
|
parsedAtRule = parseNode(atRule, 'params', {
|
|
232
232
|
isSupportAbsoluteURL,
|
|
233
233
|
isSupportDataURL,
|
|
234
|
-
externals
|
|
234
|
+
externals,
|
|
235
|
+
root
|
|
235
236
|
})
|
|
236
237
|
} catch (error) {
|
|
237
238
|
result.warn(error.message, { node: error.node })
|
|
@@ -296,10 +296,12 @@ const plugin = (options = {}) => {
|
|
|
296
296
|
|
|
297
297
|
return {
|
|
298
298
|
Declaration (declaration) {
|
|
299
|
-
const { isSupportDataURL, isSupportAbsoluteURL } = options
|
|
299
|
+
const { isSupportDataURL, isSupportAbsoluteURL, externals, root } = options
|
|
300
300
|
const parsedURL = parseDeclaration(declaration, 'value', result, {
|
|
301
301
|
isSupportDataURL,
|
|
302
|
-
isSupportAbsoluteURL
|
|
302
|
+
isSupportAbsoluteURL,
|
|
303
|
+
externals,
|
|
304
|
+
root
|
|
303
305
|
})
|
|
304
306
|
|
|
305
307
|
if (!parsedURL) {
|
package/lib/wxss/utils.js
CHANGED
|
@@ -317,7 +317,7 @@ function escapeLocalIdent (localident) {
|
|
|
317
317
|
// TODO simplify in the next major release
|
|
318
318
|
return escape(
|
|
319
319
|
localident
|
|
320
|
-
|
|
320
|
+
// For `[hash]` placeholder
|
|
321
321
|
.replace(/^((-?[0-9])|--)/, '_$1')
|
|
322
322
|
.replace(filenameReservedRegex, '-')
|
|
323
323
|
.replace(reControlChars, '-')
|
|
@@ -389,7 +389,7 @@ function defaultGetLocalIdent (
|
|
|
389
389
|
hash.update(Buffer.from(options.content, 'utf8'))
|
|
390
390
|
|
|
391
391
|
localIdentHash = (localIdentHash + hash.digest(hashDigest))
|
|
392
|
-
|
|
392
|
+
// Remove all leading digits
|
|
393
393
|
.replace(/^\d+/, '')
|
|
394
394
|
// Replace all slashes with underscores (same as in base64url)
|
|
395
395
|
.replace(/\//g, '_')
|
|
@@ -652,13 +652,13 @@ function getModulesOptions (rawOptions, exportType, loaderContext) {
|
|
|
652
652
|
if (needNamedExport) {
|
|
653
653
|
if (rawOptions.esModule === false) {
|
|
654
654
|
throw new Error(
|
|
655
|
-
|
|
655
|
+
'The \'exportType\' option with the \'css-style-sheet\' or \'string\' value requires the \'esModules\' option to be enabled'
|
|
656
656
|
)
|
|
657
657
|
}
|
|
658
658
|
|
|
659
659
|
if (modulesOptions.namedExport === false) {
|
|
660
660
|
throw new Error(
|
|
661
|
-
|
|
661
|
+
'The \'exportType\' option with the \'css-style-sheet\' or \'string\' value requires the \'modules.namedExport\' option to be enabled'
|
|
662
662
|
)
|
|
663
663
|
}
|
|
664
664
|
}
|
|
@@ -666,7 +666,7 @@ function getModulesOptions (rawOptions, exportType, loaderContext) {
|
|
|
666
666
|
if (modulesOptions.namedExport === true) {
|
|
667
667
|
if (rawOptions.esModule === false) {
|
|
668
668
|
throw new Error(
|
|
669
|
-
|
|
669
|
+
'The \'modules.namedExport\' option requires the \'esModules\' option to be enabled'
|
|
670
670
|
)
|
|
671
671
|
}
|
|
672
672
|
|
|
@@ -896,18 +896,18 @@ function getPreRequester ({ loaders, loaderIndex }) {
|
|
|
896
896
|
return cache[number]
|
|
897
897
|
}
|
|
898
898
|
|
|
899
|
-
if (number ===
|
|
900
|
-
cache[number] = ''
|
|
901
|
-
} else {
|
|
899
|
+
if (typeof number === 'number') {
|
|
902
900
|
const loadersRequest = loaders
|
|
903
901
|
.slice(
|
|
904
902
|
loaderIndex,
|
|
905
|
-
loaderIndex + 1 +
|
|
903
|
+
loaderIndex + 1 + number
|
|
906
904
|
)
|
|
907
905
|
.map((x) => x.request)
|
|
908
906
|
.join('!')
|
|
909
907
|
|
|
910
908
|
cache[number] = `-!${loadersRequest}!`
|
|
909
|
+
} else {
|
|
910
|
+
cache[number] = ''
|
|
911
911
|
}
|
|
912
912
|
|
|
913
913
|
return cache[number]
|
|
@@ -924,7 +924,7 @@ function getImportCode (imports, options) {
|
|
|
924
924
|
if (icss && options.modules.namedExport) {
|
|
925
925
|
code += `import ${
|
|
926
926
|
options.modules.exportOnlyLocals ? '' : `${importName}, `
|
|
927
|
-
|
|
927
|
+
}* as ${importName}_NAMED___ from ${url};\n`
|
|
928
928
|
} else {
|
|
929
929
|
code +=
|
|
930
930
|
type === 'url'
|
|
@@ -1039,7 +1039,7 @@ function getModuleCode (
|
|
|
1039
1039
|
options.sourceMap
|
|
1040
1040
|
? '___CSS_LOADER_API_SOURCEMAP_IMPORT___'
|
|
1041
1041
|
: '___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___'
|
|
1042
|
-
|
|
1042
|
+
});\n`
|
|
1043
1043
|
|
|
1044
1044
|
for (const item of api) {
|
|
1045
1045
|
const { url, layer, supports, media, dedupe } = item
|
|
@@ -1066,10 +1066,10 @@ function getModuleCode (
|
|
|
1066
1066
|
code = code.replace(new RegExp(replacementName, 'g'), () =>
|
|
1067
1067
|
options.modules.namedExport
|
|
1068
1068
|
? `" + ${importName}_NAMED___[${JSON.stringify(
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1069
|
+
getValidLocalName(
|
|
1070
|
+
localName,
|
|
1071
|
+
options.modules.exportLocalsConvention
|
|
1072
|
+
)
|
|
1073
1073
|
)}] + "`
|
|
1074
1074
|
: `" + ${importName}.locals[${JSON.stringify(localName)}] + "`
|
|
1075
1075
|
)
|
|
@@ -1172,7 +1172,7 @@ function getExportCode (exports, replacements, icssPluginUsed, options) {
|
|
|
1172
1172
|
? localsCode
|
|
1173
1173
|
: `${
|
|
1174
1174
|
options.esModule ? 'export default' : 'module.exports ='
|
|
1175
|
-
|
|
1175
|
+
} {\n${localsCode}\n};\n`
|
|
1176
1176
|
|
|
1177
1177
|
return code
|
|
1178
1178
|
}
|
|
@@ -1181,7 +1181,7 @@ function getExportCode (exports, replacements, icssPluginUsed, options) {
|
|
|
1181
1181
|
? localsCode
|
|
1182
1182
|
: `___CSS_LOADER_EXPORT___.locals = {${
|
|
1183
1183
|
localsCode ? `\n${localsCode}\n` : ''
|
|
1184
|
-
|
|
1184
|
+
}};\n`
|
|
1185
1185
|
}
|
|
1186
1186
|
|
|
1187
1187
|
const isCSSStyleSheetExport = options.exportType === 'css-style-sheet'
|
|
@@ -1210,7 +1210,7 @@ function getExportCode (exports, replacements, icssPluginUsed, options) {
|
|
|
1210
1210
|
|
|
1211
1211
|
code += `${
|
|
1212
1212
|
options.esModule ? 'export default ' : 'module.exports ='
|
|
1213
|
-
|
|
1213
|
+
} ${finalExport};\n`
|
|
1214
1214
|
|
|
1215
1215
|
return code
|
|
1216
1216
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/webpack-plugin",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.17",
|
|
4
4
|
"description": "mpx compile core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mpx"
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"engines": {
|
|
83
83
|
"node": ">=14.14.0"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "65458d02d8bfd5c49863f4e467e48ae76c382628"
|
|
86
86
|
}
|