Skip to content

Commit c5dbe32

Browse files
authored
fix(angular-rspack): sass-loader should not be required when using css (#32)
* fix(angular-rspack): sass-loader should not be required when using css * fix(angular-rspack): sass-loader should not be required when using css
1 parent 45e155f commit c5dbe32

File tree

6 files changed

+54
-54
lines changed

6 files changed

+54
-54
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"@vitest/ui": "^1.3.1",
6666
"angular-eslint": "^19.0.2",
6767
"commitlint-plugin-tense": "1.0.4",
68+
"css-loader": "^7.1.2",
6869
"eslint": "^9.8.0",
6970
"eslint-config-prettier": "^9.0.0",
7071
"eslint-plugin-playwright": "^1.6.2",

packages/angular-rspack/eslint.next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = [
2424
],
2525
ignoredDependencies: [
2626
'nx',
27+
'css-loader',
2728
'less-loader',
2829
'sass-loader',
2930
'sass-embedded',

packages/angular-rspack/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"license-webpack-plugin": "^4.0.2",
5555
"sass-embedded": "^1.79.3",
5656
"sass-loader": "^16.0.2",
57+
"css-loader": "^7.1.2",
5758
"tslib": "^2.3.0",
5859
"webpack-merge": "^6.0.1",
5960
"ws": "^8.18.0"

packages/angular-rspack/src/lib/config/style-config-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function getSassLoaderConfig(
1818
sourceMap?: SourceMap
1919
) {
2020
return {
21-
test: /\.?(sa|sc|c)ss$/,
21+
test: /\.?(sa|sc)ss$/,
2222
use: [
2323
{
2424
loader: 'sass-loader',

packages/angular-rspack/src/lib/config/style-config-utils.unit.test.ts

+23-21
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('getIncludePathOptions', () => {
4343
describe('getSassLoaderConfig', () => {
4444
it('should return sass loader config without options passed', () => {
4545
expect(getSassLoaderConfig()).toStrictEqual({
46-
test: /\.?(sa|sc|c)ss$/,
46+
test: /\.?(sa|sc)ss$/,
4747
use: [
4848
{
4949
loader: 'sass-loader',
@@ -127,7 +127,7 @@ describe('getStyleLoaders', () => {
127127
it('should return sass and less loader config without options passed', () => {
128128
expect(getStyleLoaders()).toStrictEqual([
129129
{
130-
test: /\.?(sa|sc|c)ss$/,
130+
test: /\.?(sa|sc)ss$/,
131131
use: [
132132
{
133133
loader: 'sass-loader',
@@ -162,26 +162,28 @@ describe('getStyleLoaders', () => {
162162
includePaths: ['path/to/a'],
163163
sass: { indentedSyntax: true },
164164
})
165-
).toStrictEqual([
166-
expect.objectContaining({
167-
use: [
168-
expect.objectContaining({
169-
options: expect.objectContaining({
170-
includePaths: ['path/to/a'],
171-
indentedSyntax: true,
165+
).toStrictEqual(
166+
expect.arrayContaining([
167+
expect.objectContaining({
168+
use: [
169+
expect.objectContaining({
170+
options: expect.objectContaining({
171+
includePaths: ['path/to/a'],
172+
indentedSyntax: true,
173+
}),
172174
}),
173-
}),
174-
],
175-
}),
176-
expect.objectContaining({
177-
use: [
178-
expect.objectContaining({
179-
options: expect.objectContaining({
180-
paths: ['path/to/a'],
175+
],
176+
}),
177+
expect.objectContaining({
178+
use: [
179+
expect.objectContaining({
180+
options: expect.objectContaining({
181+
paths: ['path/to/a'],
182+
}),
181183
}),
182-
}),
183-
],
184-
}),
185-
]);
184+
],
185+
}),
186+
])
187+
);
186188
});
187189
});

pnpm-lock.yaml

+27-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)