-
Notifications
You must be signed in to change notification settings - Fork 67
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
[WIP] Allow external scoping #294
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,11 +20,12 @@ type TransformOptions struct { | |
Site string | ||
ProjectRoot string | ||
PreprocessStyle interface{} | ||
ExternalScoping bool | ||
StaticExtraction bool | ||
} | ||
|
||
func Transform(doc *astro.Node, opts TransformOptions) *astro.Node { | ||
shouldScope := len(doc.Styles) > 0 && ScopeStyle(doc.Styles, opts) | ||
shouldScope := opts.ExternalScoping || len(doc.Styles) > 0 && ScopeStyle(doc.Styles, opts) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Components that do not have any |
||
walk(doc, func(n *astro.Node) { | ||
ExtractScript(doc, n) | ||
AddComponentProps(doc, n) | ||
|
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.
is this needed? I think that ProcessStyle has access to all of these options on the JS side anyways. Is there something that it needs?
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.
I think so. This was to have the object containing the hash value (e.g.
astro-hash1d2c3b4a
).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.
We talked about this, make sense.