feat(webpack): set default sassImplementation to sass-embedded (#30580)
## Current Behavior The `sassImplementation` option for Webpack and Rspack is set to `sass` by default. `sass-embedded` offers a faster alternative. ## Expected Behavior Switch the default `sassImplementation` option to `sass-embedded`.
This commit is contained in:
parent
caa26a781d
commit
6b081363c1
@ -143,9 +143,9 @@ export function applyWebConfig(
|
|||||||
loader: require.resolve('sass-loader'),
|
loader: require.resolve('sass-loader'),
|
||||||
options: {
|
options: {
|
||||||
implementation:
|
implementation:
|
||||||
options.sassImplementation === 'sass-embedded'
|
options.sassImplementation === 'sass'
|
||||||
? require.resolve('sass-embedded')
|
? require.resolve('sass')
|
||||||
: require.resolve('sass'),
|
: require.resolve('sass-embedded'),
|
||||||
api: 'modern-compiler',
|
api: 'modern-compiler',
|
||||||
sassOptions: {
|
sassOptions: {
|
||||||
fiber: false,
|
fiber: false,
|
||||||
@ -209,9 +209,9 @@ export function applyWebConfig(
|
|||||||
options: {
|
options: {
|
||||||
api: 'modern-compiler',
|
api: 'modern-compiler',
|
||||||
implementation:
|
implementation:
|
||||||
options.sassImplementation === 'sass-embedded'
|
options.sassImplementation === 'sass'
|
||||||
? require.resolve('sass-embedded')
|
? require.resolve('sass')
|
||||||
: require.resolve('sass'),
|
: require.resolve('sass-embedded'),
|
||||||
sourceMap: !!options.sourceMap,
|
sourceMap: !!options.sourceMap,
|
||||||
sassOptions: {
|
sassOptions: {
|
||||||
fiber: false,
|
fiber: false,
|
||||||
@ -279,9 +279,9 @@ export function applyWebConfig(
|
|||||||
options: {
|
options: {
|
||||||
api: 'modern-compiler',
|
api: 'modern-compiler',
|
||||||
implementation:
|
implementation:
|
||||||
options.sassImplementation === 'sass-embedded'
|
options.sassImplementation === 'sass'
|
||||||
? require.resolve('sass-embedded')
|
? require.resolve('sass')
|
||||||
: require.resolve('sass'),
|
: require.resolve('sass-embedded'),
|
||||||
sourceMap: !!options.sourceMap,
|
sourceMap: !!options.sourceMap,
|
||||||
sassOptions: {
|
sassOptions: {
|
||||||
fiber: false,
|
fiber: false,
|
||||||
|
|||||||
@ -161,10 +161,10 @@ export interface NxAppRspackPluginOptions {
|
|||||||
* Add an additional chunk for the rspack runtime. Defaults to `true` when `target === 'web'`.
|
* Add an additional chunk for the rspack runtime. Defaults to `true` when `target === 'web'`.
|
||||||
*/
|
*/
|
||||||
runtimeChunk?: boolean;
|
runtimeChunk?: boolean;
|
||||||
// TODO(v21): Make Sass Embedded the default in version 21.
|
|
||||||
// TODO(v22): Remove in version 22.
|
// TODO(v22): Remove in version 22.
|
||||||
/**
|
/**
|
||||||
* The implementation of the SASS compiler to use. Can be either `sass` or `sass-embedded`. Defaults to `sass-embedded`.
|
* The implementation of the SASS compiler to use. Can be either `sass` or `sass-embedded`. Defaults to `sass-embedded`.
|
||||||
|
* @deprecated Sass option will be removed in Nx 22. This option will also be removed in Nx 22 as it is no longer needed.
|
||||||
*/
|
*/
|
||||||
sassImplementation?: 'sass' | 'sass-embedded';
|
sassImplementation?: 'sass' | 'sass-embedded';
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -121,7 +121,8 @@ export function normalizeOptions(
|
|||||||
root: workspaceRoot,
|
root: workspaceRoot,
|
||||||
runtimeChunk: combinedPluginAndMaybeExecutorOptions.runtimeChunk ?? true,
|
runtimeChunk: combinedPluginAndMaybeExecutorOptions.runtimeChunk ?? true,
|
||||||
sassImplementation:
|
sassImplementation:
|
||||||
combinedPluginAndMaybeExecutorOptions.sassImplementation ?? 'sass',
|
combinedPluginAndMaybeExecutorOptions.sassImplementation ??
|
||||||
|
'sass-embedded',
|
||||||
scripts: combinedPluginAndMaybeExecutorOptions.scripts ?? [],
|
scripts: combinedPluginAndMaybeExecutorOptions.scripts ?? [],
|
||||||
sourceMap: combinedPluginAndMaybeExecutorOptions.sourceMap ?? !isProd,
|
sourceMap: combinedPluginAndMaybeExecutorOptions.sourceMap ?? !isProd,
|
||||||
sourceRoot,
|
sourceRoot,
|
||||||
|
|||||||
@ -145,9 +145,9 @@ export function applyWebConfig(
|
|||||||
options: {
|
options: {
|
||||||
api: 'modern-compiler',
|
api: 'modern-compiler',
|
||||||
implementation:
|
implementation:
|
||||||
options.sassImplementation === 'sass-embedded'
|
options.sassImplementation === 'sass'
|
||||||
? require.resolve('sass-embedded')
|
? require.resolve('sass')
|
||||||
: require.resolve('sass'),
|
: require.resolve('sass-embedded'),
|
||||||
sassOptions: {
|
sassOptions: {
|
||||||
fiber: false,
|
fiber: false,
|
||||||
precision: 8,
|
precision: 8,
|
||||||
@ -210,9 +210,9 @@ export function applyWebConfig(
|
|||||||
options: {
|
options: {
|
||||||
api: 'modern-compiler',
|
api: 'modern-compiler',
|
||||||
implementation:
|
implementation:
|
||||||
options.sassImplementation === 'sass-embedded'
|
options.sassImplementation === 'sass'
|
||||||
? require.resolve('sass-embedded')
|
? require.resolve('sass')
|
||||||
: require.resolve('sass'),
|
: require.resolve('sass-embedded'),
|
||||||
sourceMap: !!options.sourceMap,
|
sourceMap: !!options.sourceMap,
|
||||||
sassOptions: {
|
sassOptions: {
|
||||||
fiber: false,
|
fiber: false,
|
||||||
@ -280,9 +280,9 @@ export function applyWebConfig(
|
|||||||
options: {
|
options: {
|
||||||
api: 'modern-compiler',
|
api: 'modern-compiler',
|
||||||
implementation:
|
implementation:
|
||||||
options.sassImplementation === 'sass-embedded'
|
options.sassImplementation === 'sass'
|
||||||
? require.resolve('sass-embedded')
|
? require.resolve('sass')
|
||||||
: require.resolve('sass'),
|
: require.resolve('sass-embedded'),
|
||||||
sourceMap: !!options.sourceMap,
|
sourceMap: !!options.sourceMap,
|
||||||
sassOptions: {
|
sassOptions: {
|
||||||
fiber: false,
|
fiber: false,
|
||||||
|
|||||||
@ -133,7 +133,8 @@ export function normalizeOptions(
|
|||||||
targetName,
|
targetName,
|
||||||
vendorChunk: combinedPluginAndMaybeExecutorOptions.vendorChunk ?? !isProd,
|
vendorChunk: combinedPluginAndMaybeExecutorOptions.vendorChunk ?? !isProd,
|
||||||
sassImplementation:
|
sassImplementation:
|
||||||
combinedPluginAndMaybeExecutorOptions.sassImplementation ?? 'sass',
|
combinedPluginAndMaybeExecutorOptions.sassImplementation ??
|
||||||
|
'sass-embedded',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -221,10 +221,10 @@ export interface NxAppWebpackPluginOptions {
|
|||||||
* Use tsconfig-paths-webpack-plugin to resolve modules using paths in the tsconfig file.
|
* Use tsconfig-paths-webpack-plugin to resolve modules using paths in the tsconfig file.
|
||||||
*/
|
*/
|
||||||
useTsconfigPaths?: boolean;
|
useTsconfigPaths?: boolean;
|
||||||
// TODO(v21): Make Sass Embedded the default in version 21.
|
|
||||||
// TODO(v22): Remove in version 22.
|
// TODO(v22): Remove in version 22.
|
||||||
/**
|
/**
|
||||||
* The implementation of the SASS compiler to use. Can be either `sass` or `sass-embedded`. Defaults to `sass-embedded`.
|
* The implementation of the SASS compiler to use. Can be either `sass` or `sass-embedded`. Defaults to `sass-embedded`.
|
||||||
|
* @deprecated Sass option will be removed in Nx 22. This option will also be removed in Nx 22 as it is no longer needed.
|
||||||
*/
|
*/
|
||||||
sassImplementation?: 'sass' | 'sass-embedded';
|
sassImplementation?: 'sass' | 'sass-embedded';
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user