Skip to content

Commit 2ba44a4

Browse files
alan-agius4dgp1130
authored andcommitted
refactor(@angular-devkit/build-angular): remove support for Stylus
The usage of Stylus in the CLI is minimal and this package never reached version 1. BREAKING CHANGE: Deprecated support for Stylus has been removed. The Stylus package has never reached a stable version and its usage in the Angular CLI is minimal. It's recommended to migrate to another CSS preprocessor that the Angular CLI supports.
1 parent 12931ba commit 2ba44a4

File tree

17 files changed

+18
-143
lines changed

17 files changed

+18
-143
lines changed

docs/design/build-system-overview.dot

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ digraph G {
88
"*.css" -> "postcss-loader with postcss-import, ./postcss-cli-resources.ts, autoprefixer";
99
"*.scss\|sass" -> "sass-loader" -> "postcss-loader with postcss-import, ./postcss-cli-resources.ts, autoprefixer";
1010
"*.less" -> "less-loader" -> "postcss-loader with postcss-import, ./postcss-cli-resources.ts, autoprefixer";
11-
"*.styl" -> "stylus-loader" -> "postcss-loader with postcss-import, ./postcss-cli-resources.ts, autoprefixer";
1211
"postcss-loader with postcss-import, ./postcss-cli-resources.ts, autoprefixer" -> "raw-loader, ./optimize-css-webpack-plugin.ts" [label="component style?"];
1312
"raw-loader" -> "./optimize-css-webpack-plugin.ts"
1413
"postcss-loader with postcss-import, ./postcss-cli-resources.ts, autoprefixer" -> "style-loader, ./raw-css-loader.ts, and mini-css-extract-plugin" [label="global style?"];
1514
"style-loader, ./raw-css-loader.ts, and mini-css-extract-plugin" -> "./optimize-css-webpack-plugin.ts"
16-
}
15+
}

docs/design/build-system.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ This is used for conditional loading of code at build time.
5454
Two types of stylesheets are used in the build system: global stylesheets and component stylesheets.
5555
Global stylesheets are injected into the `index.html` file, while component stylesheets are loaded directly into compiled Angular components.
5656

57-
The build system supports plain CSS stylesheets as well as the Sass, LESS and Stylus CSS pre-processors.
58-
Stylesheet processing functionality is provided by `sass-loader`, `less-loader`, `stylus-loader`, `postcss-loader`, `postcss-import`, augmented in the build system by custom webpack plugins.
57+
The build system supports plain CSS stylesheets as well as the Sass and LESS CSS pre-processors.
58+
Stylesheet processing functionality is provided by `sass-loader`, `less-loader`, `postcss-loader`, `postcss-import`, augmented in the build system by custom webpack plugins.
5959

6060
### Assets
6161

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,6 @@
204204
"source-map-loader": "4.0.0",
205205
"source-map-support": "0.5.21",
206206
"spdx-satisfies": "^5.0.0",
207-
"stylus": "0.59.0",
208-
"stylus-loader": "7.0.0",
209207
"symbol-observable": "4.0.0",
210208
"tar": "^6.1.6",
211209
"terser": "5.15.0",

packages/angular_devkit/build_angular/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ ts_library(
170170
"@npm//semver",
171171
"@npm//source-map-loader",
172172
"@npm//source-map-support",
173-
"@npm//stylus",
174-
"@npm//stylus-loader",
175173
"@npm//terser",
176174
"@npm//text-table",
177175
"@npm//tree-kill",

packages/angular_devkit/build_angular/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@
5757
"semver": "7.3.7",
5858
"source-map-loader": "4.0.0",
5959
"source-map-support": "0.5.21",
60-
"stylus": "0.59.0",
61-
"stylus-loader": "7.0.0",
6260
"terser": "5.15.0",
6361
"text-table": "0.2.0",
6462
"tree-kill": "1.2.2",

packages/angular_devkit/build_angular/src/builders/browser-esbuild/schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"input": {
7373
"type": "string",
7474
"description": "The file to include.",
75-
"pattern": "\\.(?:css|scss|sass|less|styl)$"
75+
"pattern": "\\.(?:css|scss|sass|less)$"
7676
},
7777
"bundleName": {
7878
"type": "string",
@@ -91,7 +91,7 @@
9191
{
9292
"type": "string",
9393
"description": "The file to include.",
94-
"pattern": "\\.(?:css|scss|sass|less|styl)$"
94+
"pattern": "\\.(?:css|scss|sass|less)$"
9595
}
9696
]
9797
}

packages/angular_devkit/build_angular/src/builders/browser/schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"input": {
7373
"type": "string",
7474
"description": "The file to include.",
75-
"pattern": "\\.(?:css|scss|sass|less|styl)$"
75+
"pattern": "\\.(?:css|scss|sass|less)$"
7676
},
7777
"bundleName": {
7878
"type": "string",
@@ -91,7 +91,7 @@
9191
{
9292
"type": "string",
9393
"description": "The file to include.",
94-
"pattern": "\\.(?:css|scss|sass|less|styl)$"
94+
"pattern": "\\.(?:css|scss|sass|less)$"
9595
}
9696
]
9797
}

packages/angular_devkit/build_angular/src/builders/browser/specs/styles_spec.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import { dirname } from 'path';
1313
import { browserBuild, createArchitect, host } from '../../../testing/test-utils';
1414

1515
describe('Browser Builder styles', () => {
16-
const extensionsWithImportSupport = ['css', 'scss', 'less', 'styl'];
17-
const extensionsWithVariableSupport = ['scss', 'less', 'styl'];
16+
const extensionsWithImportSupport = ['css', 'scss', 'less'];
17+
const extensionsWithVariableSupport = ['scss', 'less'];
1818
const imgSvg = `
1919
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
2020
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
@@ -223,9 +223,6 @@ describe('Browser Builder styles', () => {
223223
if (ext === 'scss') {
224224
variableAssignment = '$primary-color:';
225225
variablereference = '$primary-color';
226-
} else if (ext === 'styl') {
227-
variableAssignment = '$primary-color =';
228-
variablereference = '$primary-color';
229226
} else if (ext === 'less') {
230227
variableAssignment = '@primary-color:';
231228
variablereference = '@primary-color';

packages/angular_devkit/build_angular/src/builders/browser/tests/options/bundle-budgets_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Type } from '../../schema';
1313
import { BASE_OPTIONS, BROWSER_BUILDER_INFO, describeBuilder } from '../setup';
1414

1515
describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
16-
const CSS_EXTENSIONS = ['css', 'scss', 'less', 'styl'];
16+
const CSS_EXTENSIONS = ['css', 'scss', 'less'];
1717
const BUDGET_NOT_MET_REGEXP = /Budget .+ was not met by/;
1818

1919
describe('Option: "bundleBudgets"', () => {

packages/angular_devkit/build_angular/src/builders/browser/tests/options/inline-style-language_spec.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,29 +58,6 @@ describeBuilder(buildWebpackBrowser, BROWSER_BUILDER_INFO, (harness) => {
5858
harness.expectFile('dist/main.js').content.toContain('color: green');
5959
});
6060

61-
// Stylus currently does not function due to the sourcemap logic within the `stylus-loader`
62-
// which tries to read each stylesheet directly from disk. In this case, each stylesheet is
63-
// virtual and cannot be read from disk. This issue affects data URIs in general.
64-
// xit('supports Stylus inline component styles when set to "stylus"', async () => {
65-
// harness.useTarget('build', {
66-
// ...BASE_OPTIONS,
67-
// inlineStyleLanguage: InlineStyleLanguage.Stylus,
68-
// aot,
69-
// });
70-
71-
// await harness.modifyFile('src/app/app.component.ts', (content) =>
72-
// content.replace(
73-
// '__STYLE_MARKER__',
74-
// '$primary = green;\\nh1 { color: $primary; }',
75-
// ),
76-
// );
77-
78-
// const { result } = await harness.executeOnce();
79-
80-
// expect(result?.success).toBe(true);
81-
// harness.expectFile('dist/main.js').content.toContain('color: green');
82-
// });
83-
8461
it('supports Less inline component styles when set to "less"', async () => {
8562
harness.useTarget('build', {
8663
...BASE_OPTIONS,

0 commit comments

Comments
 (0)