Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): resolve less from build-angular p…
Browse files Browse the repository at this point in the history
…ackage
  • Loading branch information
alan-agius4 authored and dgp1130 committed Jan 22, 2021
1 parent 5711e69 commit cc51432
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"karma-jasmine-html-reporter": "^1.5.0",
"karma-source-map-support": "1.4.0",
"less": "4.1.0",
"less-loader": "7.2.1",
"less-loader": "7.3.0",
"license-checker": "^25.0.0",
"license-checker-webpack-plugin": "0.2.1",
"loader-utils": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"jest-worker": "26.6.2",
"karma-source-map-support": "1.4.0",
"less": "4.1.0",
"less-loader": "7.2.1",
"less-loader": "7.3.0",
"license-webpack-plugin": "2.3.11",
"loader-utils": "2.0.0",
"mini-css-extract-plugin": "1.3.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
{
loader: require.resolve('less-loader'),
options: {
implementation: require('less'),
sourceMap: cssSourceMap,
lessOptions: {
javascriptEnabled: true,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7091,10 +7091,10 @@ lcid@^2.0.0:
dependencies:
invert-kv "^2.0.0"

less-loader@7.2.1:
version "7.2.1"
resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-7.2.1.tgz#a923df8567256751b0ab4e0c3eecff10fd0a5876"
integrity sha512-4v83WZ7KGbluOWPgk3iNjreAaJDNStfmmdfJbQIib3Jlc8mejV3w6A9xU+EkaivjBVqwQEK0y8cFthyNeGnrTQ==
less-loader@7.3.0:
version "7.3.0"
resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-7.3.0.tgz#f9d6d36d18739d642067a05fb5bd70c8c61317e5"
integrity sha512-Mi8915g7NMaLlgi77mgTTQvK022xKRQBIVDSyfl3ErTuBhmZBQab0mjeJjNNqGbdR+qrfTleKXqbGI4uEFavxg==
dependencies:
klona "^2.0.4"
loader-utils "^2.0.0"
Expand Down

4 comments on commit cc51432

@GrantGochnauer
Copy link

@GrantGochnauer GrantGochnauer commented on cc51432 Feb 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since making this update, Angular will no longer compile Semantic UI or Fomantic UI because less 4.x is used during compile time instead of Less 3.0. This was a breaking change between 11.1 and 11.2. Previously Less was resolved in our package.json devDependencies.

@alan-agius4
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In version 11.1, less compiler 4.1.0 was being used

. However in some cases the wrong compiler was being picked up and this corrected that behaviour.

@GrantGochnauer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. It does mean that if folks previously supplied their own less 3.x version, it no longer will use that and instead use the 4.x which I realize is desired. I did check with the Fomantic project and it looks like they are fixing the LESS to be 4.x compatible in the next release so this should only be a short-term issue. Thanks for the quick response!

@alan-agius4
Copy link
Collaborator Author

@alan-agius4 alan-agius4 commented on cc51432 Feb 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. It does mean that if folks previously supplied their own less 3.x version, it no longer will use that and instead use the 4.x which I realize is desired.

That is more of a defect, because build-angular provides it's own version of less, hence if the user installed less in their project it should have never been picked up as is not a peer dependency.

I also did a PR to change the math behaviour in version 11, this #20097

Please sign in to comment.