-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sassOption
implementation
to support sass-embedded (#64577)
This PR adds an option to use `sass-embedded`. For large projects sass-embedded improves SCSS compilation time by over 50%. See also #36160 Added a sassOption `implementation` to configure the sass-loader which Sass implementation to use. See also https://www.npmjs.com/package/sass-loader#implementation I think this a similar approach to what is done for `additionalData`. In order to support `sass-embedded`, `sass-loader` is upgraded to 12.6.0. --------- Co-authored-by: Zack Tanner <[email protected]>
- Loading branch information
1 parent
2018e6a
commit 26c9c63
Showing
44 changed files
with
1,051 additions
and
602 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -287,7 +287,7 @@ | |
"react-is": "18.2.0", | ||
"react-refresh": "0.12.0", | ||
"regenerator-runtime": "0.13.4", | ||
"sass-loader": "12.4.0", | ||
"sass-loader": "12.6.0", | ||
"schema-utils2": "npm:[email protected]", | ||
"schema-utils3": "npm:[email protected]", | ||
"semver": "7.3.2", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
test/e2e/app-dir/scss/basic-module-additional-data/next.config.js
This file was deleted.
Oops, something went wrong.
44 changes: 30 additions & 14 deletions
44
test/e2e/app-dir/scss/basic-module-include-paths/basic-module-include-paths.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,36 @@ | ||
/* eslint-env jest */ | ||
|
||
import { nextTestSetup } from 'e2e-utils' | ||
import { colorToRgb } from 'next-test-utils' | ||
|
||
describe('Basic Module Include Paths Support', () => { | ||
const { next } = nextTestSetup({ | ||
files: __dirname, | ||
dependencies: { | ||
sass: '1.54.0', | ||
const sassOptions = { | ||
includePaths: ['./styles'], | ||
} | ||
|
||
describe.each([ | ||
{ dependencies: { sass: '1.54.0' }, nextConfig: { sassOptions } }, | ||
{ | ||
dependencies: { 'sass-embedded': '1.75.0' }, | ||
nextConfig: { | ||
sassOptions: { | ||
...sassOptions, | ||
implementation: 'sass-embedded', | ||
}, | ||
}, | ||
}) | ||
}, | ||
])( | ||
'Basic Module Include Paths Support ($dependencies)', | ||
({ dependencies, nextConfig }) => { | ||
const { next } = nextTestSetup({ | ||
files: __dirname, | ||
dependencies, | ||
nextConfig, | ||
}) | ||
|
||
it('should render the module', async () => { | ||
const browser = await next.browser('/') | ||
expect( | ||
await browser.elementByCss('#verify-red').getComputedCss('color') | ||
).toBe(colorToRgb('red')) | ||
}) | ||
}) | ||
it('should render the module', async () => { | ||
const browser = await next.browser('/') | ||
expect( | ||
await browser.elementByCss('#verify-red').getComputedCss('color') | ||
).toBe(colorToRgb('red')) | ||
}) | ||
} | ||
) |
7 changes: 0 additions & 7 deletions
7
test/e2e/app-dir/scss/basic-module-include-paths/next.config.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
test/e2e/app-dir/scss/basic-module-prepend-data/next.config.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.