next.js
bd37836f - fix(turbopack): Recognize urls starting with // as external (#77526)

Commit
274 days ago
fix(turbopack): Recognize urls starting with // as external (#77526) - fixes [PACK-3337](https://linear.app/vercel/issue/PACK-3337/detect-urlexamplecomblahcss-as-external-in-css-imports) - This fix allows users to put a url like `@import "//example.com/stylesheet.css"` in their css files and be treated as an external url with no specified protocol - Refactors the code for readability by splitting up the different types of patterns into their own respective handler functions - Moved the `lazy_static` section outside of the function definition to slightly increase performance by no longer needing the runtime checks for those elements initialization. - Added a test case to help make sure that the output matches what we expect when encountering protocol-relative urls (e.g. `//example.com/stylesheet.css`)
Author
Parents
Loading