-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(turbopack): basic sass-loader support #4985
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Ignored Deployments
|
✅ This change can build |
|
Linux Benchmark for ed89e67
Click to view full benchmark
|
MacOS Benchmark for ed89e67
Click to view full benchmark
|
for (let i = 0; i < errorStack.length; i++) { | ||
if (errorStack[i].includes(flag)) { | ||
errorStack.length = i; | ||
} | ||
} |
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 missing a break statement?
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.
Same goes for https://github.com/vercel/turbo/pull/4985/files#r1197370422, could cut it but thought it'd better to preserve these logics as much as same.
* @param {string} stack stack trace | ||
* @returns {string} stack trace without the loader execution flag included | ||
*/ | ||
const cutOffLoaderExecution = (stack) => cutOffByFlag(stack, loaderFlag); |
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.
Can you explain why this is needed?
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.
These are copy-paste from what webpack does for the logging with its levels. We could not do it, but tried to mimic its behavior as much.
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.
Linux Benchmark for 2a6680dClick to view benchmark
|
MacOS Benchmark for 2a6680d
Click to view full benchmark
|
rootContext: contextDir, | ||
getOptions() { | ||
const entry = this.loaders[this.loaderIndex]; | ||
return entry.options && typeof entry.options === "object" | ||
? entry.options | ||
: {}; | ||
}, | ||
getResolve: () => ({ | ||
// [TODO] this is incomplete |
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 should have a __turbopack_require_context__.resolve()
which is our module runtime's resolver.
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Linux Benchmark for 7905ffe
Click to view full benchmark
|
Windows Benchmark for 7905ffe
Click to view full benchmark
|
MacOS Benchmark for 7905ffe
Click to view full benchmark
|
Description
WEB-654.
This is pairing PR from next.js vercel/next.js#49882 (not a breaking change though) to have necessary support to run sass-loader. Mainly, it adds near-dummy context in
webpack-loaders
as well as assigning specific module types for the scss / sass.I'm not entirely in favor of having internal custom module type logic in webpack loaders setup by extension - however next.config.js itself doesn't have enough information other than extension + loader to determine module type. Something would like to address.