-
Notifications
You must be signed in to change notification settings - Fork 6
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
Include in response only CSS variations that are needed #41
Conversation
.reduce((prev, name) => { | ||
prev.push( | ||
path.join(assetDir, 'js', `${name}.js`), | ||
path.join(assetDir, 'js', `${name}.${slug}.js`), |
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.
don't think we have site-specific component js?
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 looks like it was pulled from the previous version that also got three js files for each component https://github.com/clay/amphora-html/blob/v3.3.0/lib/media.js#L192
I can't necessarily speak to why it was setup that way originally, but I suspect it was included here for compatibility reasons
const siteSlug = site && site.slug; | ||
|
||
cssFilePaths = state._components | ||
.reduce((acc, curr) => { |
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.
what is the var acc
referring to?
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.
Pretty sure it's the local var for the accumulation of the reduction, could probably change this to pathsToRetrieve
or something if that's more clear
Ensures CSS variations that do not appear on the requested page do not appear in the response HTML.