core icon indicating copy to clipboard operation
core copied to clipboard

Add support for angular 20

Open Canoobi opened this issue 6 months ago • 4 comments

To upgrade Angular in our project to version 20, remove all leading tildes (~) from your SCSS import paths. Angular 20 no longer recognizes the ~ prefix as an alias for node_modules, so keeping it will cause your stylesheet imports to fail.

Canoobi avatar Jul 03 '25 07:07 Canoobi

src/styles/_webpack.assets-paths.scss:
@@ -1,3 +1,3 @@
-$icons-path: "~@db-ui/core/dist/icons/";
-$images-path: "~@db-ui/core/dist/images/";
-$fonts-path: "~@db-ui/core/dist/fonts/";
+$icons-path: "@db-ui/core/dist/icons/";
+$images-path: "@db-ui/core/dist/images/";
+$fonts-path: "@db-ui/core/dist/fonts/";

Canoobi avatar Jul 03 '25 08:07 Canoobi

@Canoobi thanks a lot for your feedback. To my knowledge, Angular even also switched from Webpack to vite or another rollup based bundler. So would switching to the _rollup.assets-paths.scss file work for you, that doesn't include those tildes anymore?

mfranzke avatar Jul 03 '25 18:07 mfranzke

@mfranzke thanks for the tip! I'll have a look and give you feedback.

Canoobi avatar Jul 03 '25 19:07 Canoobi

Angular is using esbuild directly (and Vite just for the dev server).

But my team is successfully using rollup asset paths:

@use "@db-ui/core/sources/css/rollup.assets-paths" as rollupAssetsPaths;
@use "@db-ui/core/sources/css/enterprise/db-ui-core" with (
  $icons-path: rollupAssetsPaths.$icons-path,
  $images-path: rollupAssetsPaths.$images-path,
  $fonts-path: rollupAssetsPaths.$fonts-path
);

jonaskuske avatar Jul 16 '25 14:07 jonaskuske