We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
出问题的代码:https://github.com/raxjs/rax-scripts/blob/083d98416234e1d031c6e405d01e1fc42ac8eb6f/packages/stylesheet-loader/src/index.js#L156
inlinceCSS 的模式打包 animate.css,_styles[key] 可能为空,导致 Object.assign 报错。
打包前:
@media print, (prefers-reduced-motion: reduce) { .animate__animated { -webkit-animation-duration: 1ms !important; animation-duration: 1ms !important; -webkit-transition-duration: 1ms !important; transition-duration: 1ms !important; -webkit-animation-iteration-count: 1 !important; animation-iteration-count: 1 !important; } .animate__animated[class*='Out'] { opacity: 0; } }
打包后
var i = { animate__animated: { WebkitAnimationDuration: "1ms !important", animationDuration: "1ms !important", WebkitTransitionDuration: "1ms !important", transitionDuration: "1ms", WebkitAnimationIterationCount: "1 !important", animationIterationCount: "1 !important" }, "animate__animated[class*='Out']": { opacity: 0 } // 这一条在 _styles 里不存在 };
要看下为啥这条样式在打包后丢失了。
以及为了保证健壮性,建议可以加上 为空判断 || {},来兼容不报错:
_styles[key] = Object.assign(_styles[key] || {}, ruleData[key]);
The text was updated successfully, but these errors were encountered:
boiawang
Successfully merging a pull request may close this issue.
出问题的代码:https://github.com/raxjs/rax-scripts/blob/083d98416234e1d031c6e405d01e1fc42ac8eb6f/packages/stylesheet-loader/src/index.js#L156
inlinceCSS 的模式打包 animate.css,_styles[key] 可能为空,导致 Object.assign 报错。
打包前:
打包后
要看下为啥这条样式在打包后丢失了。
以及为了保证健壮性,建议可以加上 为空判断 || {},来兼容不报错:
The text was updated successfully, but these errors were encountered: