-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix source maps issue resulting in a crash #11319
Conversation
b707d61
to
4c85145
Compare
'13:8 -> 22:8', | ||
'13:31 -> 23:0', | ||
]) | ||
expect(annotations).toMatchInlineSnapshot(` |
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.
Now that we don't use crosscheck
anymore, we can use toMatchInlineSnapshot
again!
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.
🎉🎉🎉
ecf472c
to
293dd8a
Compare
293dd8a
to
900d859
Compare
@@ -38,33 +38,34 @@ test.skip('apply generates source maps', async () => { | |||
// All CSS generated by Tailwind CSS should be annotated with source maps | |||
// And always be able to point to the original source file | |||
expect(sources).not.toContain('<no source>') | |||
expect(sources.length).toBe(1) | |||
expect(sources.length).toBe(2) |
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.
All of these are increased by 1. If you (temporarily) set the minify: false
to minify: true
in the lightningCssPlugin then it goes down by 1 again.
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.
the number of sources should definitely just be 1
Introducing additional sources that disappear during minification sounds like a lightningcss bug. I'll set up an isolated test case for that and file a bug report.
900d859
to
6a9126b
Compare
6a9126b
to
9bd7e8b
Compare
This will get rid of special characters that can cause issues / confusion when debugging tests.
…rect source Co-authored-by: Jordan Pittman <jordan@cryptica.me>
7ed65e2
to
a4e5838
Compare
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.
aside from the source path issues which is probs a lightning bug this LGTM. We can merge it and take care of those later.
This PR fixes an issue where source maps weren't properly working. This is because we started using Lightning CSS in between our PostCSS plugins.
The implementation of Lightning CSS currently re-parses the CSS therefore losing the original information from the
root
tree. After that we reset the result.root based on the result of Lightning CSS.This PR should resolve the source map issues by passing the previous source maps to Lightning CSS, and passing the resulting source maps from Lightning CSS back to PostCSS.