Skip to content

Commit bf236d3

Browse files
committed
fix: 修改相关格式
1 parent 4c20c78 commit bf236d3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/webpack-plugin/lib/wxss/loader.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ module.exports = async function loader (content, map, meta) {
9292
filter: options.import.filter,
9393
urlHandler: (url) => {
9494
url = combineRequests(getPreRequester(this)(options.importLoaders), url)
95+
if (isRN) {
96+
return stringifyRequest(this, url)
97+
}
9598
return getRequestString('styles', { src: url }, {
9699
isStatic: true,
97100
issuerResource: this.resource,
98-
fromImport: true,
99-
...(isRN ? { extract: false } : {})
101+
fromImport: true
100102
})
101103
}
102104
})

packages/webpack-plugin/lib/wxss/utils.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,7 @@ function getModuleCode (
10591059
if (isRN) {
10601060
beforeCode += `___CSS_LOADER_EXPORT___.i(${item.importName}${hasParams ? `, ${printedParam}` : ''});\n`
10611061
} else {
1062-
const otherParams = hasParams ? printedParam : ''
1063-
beforeCode += `___CSS_LOADER_EXPORT___.push([module.id, '@import "' + ${item.importName} + '";', ${JSON.stringify(otherParams)} ]);\n`
1062+
beforeCode += `___CSS_LOADER_EXPORT___.push([module.id, '@import "' + ${item.importName} + '";'${hasParams ? `, ${printedParam}` : ''}]);\n`
10641063
}
10651064
}
10661065
}

0 commit comments

Comments
 (0)