Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): stylus not resolving imports from…
Browse files Browse the repository at this point in the history
… libraries

- Adds usage of webpackImporter https://www.npmjs.com/package/stylus-loader#webpackimporter
- Removes resolve-url-loader usage since stylus handles resolve paths https://stylus-lang.com/docs/js.html#stylusresolveroptions

Closes #19524
  • Loading branch information
alan-agius4 authored and clydin committed Dec 3, 2020
1 parent a46bad4 commit 227804f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
"speed-measure-webpack-plugin": "1.3.3",
"style-loader": "2.0.0",
"stylus": "0.54.7",
"stylus-loader": "4.3.0",
"stylus-loader": "4.3.1",
"symbol-observable": "3.0.0",
"tar": "^6.0.0",
"temp": "^0.9.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 @@ -64,7 +64,7 @@
"speed-measure-webpack-plugin": "1.3.3",
"style-loader": "2.0.0",
"stylus": "0.54.8",
"stylus-loader": "4.3.0",
"stylus-loader": "4.3.1",
"terser": "5.5.1",
"terser-webpack-plugin": "4.2.3",
"text-table": "0.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,10 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
{
test: /\.styl$/,
use: [
{
loader: require.resolve('resolve-url-loader'),
options: {
sourceMap: cssSourceMap,
},
},
{
loader: require.resolve('stylus-loader'),
options: {
sourceMap: cssSourceMap,
webpackImporter: false,
stylusOptions: {
compress: false,
sourceMap: { comment: false },
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11519,10 +11519,10 @@ stylehacks@^4.0.0:
postcss "^7.0.0"
postcss-selector-parser "^3.0.0"

stylus-loader@4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/stylus-loader/-/stylus-loader-4.3.0.tgz#d4bab5a4d957f4b1f567be108185ff23be216ad4"
integrity sha512-S6j5Onp4AJJIXZomHYknFEnV6/4zhPoEKxMPu0iExPgJLlGO7CeBGu+xpYCup1hiZmDBnC3BKRswADKN9goLfw==
stylus-loader@4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/stylus-loader/-/stylus-loader-4.3.1.tgz#8b4e749294d9fe0729c2e5e1f04cbf87e1c941aa"
integrity sha512-apDYJEM5ZpOAWbWInWcsbtI8gHNr/XYVcSY/tWqOUPt7M5tqhtwXVsAkgyiVjhuvw2Yrjq474a9H+g4d047Ebw==
dependencies:
fast-glob "^3.2.4"
klona "^2.0.4"
Expand Down

0 comments on commit 227804f

Please sign in to comment.