Skip to content

Conversation

@Blackgan3
Copy link
Collaborator

修复输出RN时style block内单独@import css文件时报错问题

const printedParam = printParams(media, dedupe, supports, layer)
const otherParams = printedParam.length > 0 ? printedParam : ''
beforeCode += `___CSS_LOADER_EXPORT___.push([module.id, '@import "' + ${item.importName} + '";', ${JSON.stringify(otherParams)} ]);\n`
beforeCode += `___CSS_LOADER_EXPORT___.i(${item.importName}${printedParam.length > 0 ? `, ${printedParam}` : ''});\n`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥要改这块?

filter: options.import.filter,
urlHandler: (url) => {
url = combineRequests(getPreRequester(this)(options.importLoaders), url)
return getRequestString('styles', { src: url }, {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里走原始的stringifyRequest就可以了吧

if (isRN) {
beforeCode += `___CSS_LOADER_EXPORT___.i(${item.importName}${hasParams ? `, ${printedParam}` : ''});\n`
} else {
const otherParams = hasParams ? printedParam : ''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你这个printedParams的处理两个分支能不能拉齐一下。。。逼死强迫症

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants