New issue
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
Add support for collectting html inline-style dependencies(#541) #947
Add support for collectting html inline-style dependencies(#541) #947
Conversation
remove needless code
Codecov Report
@@ Coverage Diff @@
## master #947 +/- ##
==========================================
+ Coverage 87.46% 92.73% +5.27%
==========================================
Files 74 67 -7
Lines 3493 2422 -1071
==========================================
- Hits 3055 2246 -809
+ Misses 438 176 -262
Continue to review full report at Codecov.
|
@@ -92,6 +93,24 @@ class HTMLAsset extends Asset { | |||
return newSources.join(','); | |||
} | |||
|
|||
collectInlineStyleDependencies(inlineStyle) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is very hard to read. Could you try to add comments to make it easier to understand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just add it in the newest commit.
src/assets/HTMLAsset.js
Outdated
@@ -92,6 +93,27 @@ class HTMLAsset extends Asset { | |||
return newSources.join(','); | |||
} | |||
|
|||
collectInlineStyleDependencies(inlineStyle) { | |||
// split inline styles to rule array and filter the non-epmty ones | |||
const styles = inlineStyle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we parse the css using a real css parser like postcss to process this rather than implementing our own? Check out how we collect dependencies in the CSSAsset.
Is there any progress in this work? |
sorry for the late response. |
Hey sorry for the delay here. I'm going to close this in favor of #1456 since that passes style attributes through to the existing CSSAsset for full processing along with inline style and script tags. Should handle everything that was done in this PR with less code duplication. |
Add support for collectting html inline-style dependencies.
Fixes(#541)