Angular Monorepo shared assets with Basehref

730 views Asked by At

I'm working on a new project and set up a new nx angular Monorepo. I added a lib with general styles and also global assets. I followed this article: https://medium.com/@nit3watch/angular-shared-assets-with-multiple-apps-nrwl-nx-b4801c05c771 Everything is working in dev mode, just in prod mode i can't get the image inside scss with url(). The problem is that i set baseHref inside angular.json and this baseHref is missing inside the image url. Does any one knows how to fix this?

I have added the asstes this way to the Project:

  {
            "glob": "**/*",
            "input": "./libs/styles-lib/src/lib/",
            "output": "/global-assets/"
          }

Inside scss: background-image: url("/global-assets/img/bg_btn.png");

1

There are 1 answers

0
keschra On

It is working just this way: url("^global-assets/img/bg_btn.png");