-
Notifications
You must be signed in to change notification settings - Fork 59
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 annotateSourceFile
option
#375
Conversation
🦋 Changeset detectedLatest commit: 705951c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
internal/transform/transform_test.go
Outdated
name: "basic", | ||
source: `<div>Hello world!</div>`, | ||
want: `<div data-astro-source-file="/test.astro">Hello world!</div>`, |
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 inject data-astro-source-file={transformOpts.Pathname}
to any elements.
name: "no components", | ||
source: `<Component>Hello world!</Component>`, | ||
want: `<Component>Hello world!</Component>`, |
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 ignore components
internal/transform/transform_test.go
Outdated
name: "injects root", | ||
source: `<html></html>`, | ||
want: `<html data-astro-source-root="file://"></html>`, |
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 inject data-astro-source-root={transformOpts.ProjectRoot}
to the html
element
internal/transform/transform.go
Outdated
ProjectRoot string | ||
PreprocessStyle interface{} | ||
StaticExtraction bool | ||
AnnotateSourceFile bool |
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 is a new annotateSourceFile: boolean
option for the compiler
9fe1c45
to
f19c778
Compare
f19c778
to
92288f7
Compare
92288f7
to
4924894
Compare
4924894
to
87b13d4
Compare
c63fc41
to
49058cb
Compare
Tested it with withastro/astro#9016, and it works! |
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.
Approved!
Changes
Testing
Docs
N/A